JADE v6.1

com.dautelle.math.numbers
Class Float64

java.lang.Object
  extended byjava.lang.Number
      extended bycom.dautelle.math.numbers.RealtimeNumber
          extended bycom.dautelle.math.numbers.Float64
All Implemented Interfaces:
java.lang.Comparable, Operable, Realtime, Representable, java.io.Serializable

public final class Float64
extends RealtimeNumber
implements java.lang.Comparable

This class represents a 64 bits floating point number.

Version:
5.1, August 27, 2003
Author:
Jean-Marie Dautelle
See Also:
Serialized Form

Nested Class Summary
static class Float64.Value
          This inner class represents a mutable image of an immutable Float64.
 
Nested classes inherited from class com.dautelle.math.numbers.RealtimeNumber
RealtimeNumber.Factory
 
Field Summary
static Float64 ONE
          The 64 bits float one.
static Float64 ZERO
          The 64 bits floating point representing zero.
 
Method Summary
 Float64 abs()
          Returns the absolute value of this number.
 Float64 add(Float64 that)
          Returns the sum of this number with the one specified.
 java.lang.StringBuffer appendTo(java.lang.StringBuffer sb)
          Appends the decimal text representation of this number to the StringBuffer argument.
 int compareTo(Float64 that)
          Compares two 64 bits float numerically.
 int compareTo(java.lang.Object that)
           
 Float64 divide(Float64 that)
          Returns this number divided by the one specified.
 double doubleValue()
          Returns the value of this number as a double.
 boolean equals(java.lang.Object that)
          Compares this number against the specified object.
 Float64 exp()
          Returns the exponential number e raised to the power of this number.
 float floatValue()
          Returns the value of this number as a float.
 int hashCode()
          Returns the hash code for this number.
 int intValue()
          Returns the value of this number as an int.
 Float64 inverse()
          Returns the inverse of this number.
 boolean isInfinite()
          Indicates if this number is infinite.
 boolean isNaN()
          Indicates if this number is not a number.
 Float64 log()
          Returns the natural logarithm (base e) of this number.
 long longValue()
          Returns the value of this number as a long.
 Float64 multiply(Float64 that)
          Returns the product of this number with the one specified.
 Float64 negate()
          Returns the negation of this number.
 Operable opposite()
          Returns the additive inverse of this object.
 Operable plus(Operable that)
          Returns the sum of this object with the one specified.
 Float64 pow(double e)
          Returns this number raised to the specified power.
 Float64 pow(Float64 that)
          Returns this number raised to the power of the specified exponent.
 Operable reciprocal()
          Returns the multiplicative inverse of this object.
 Float64 sqrt()
          Returns the positive square root of this number.
 Float64 subtract(Float64 that)
          Returns the difference between this number and the one specified.
 Operable times(Operable that)
          Returns the product of this object with the one specified.
 java.lang.String toString()
          Returns the decimal text representation of this number.
 void toXml(XmlElement xml)
          Sets the attributes and content of the XML element corresponding to this object.
static Float64 valueOf(java.lang.CharSequence chars)
          Returns the number for the specified character sequence.
static Float64 valueOf(double doubleValue)
          Returns the 64 bits float of specified double value.
static Float64 valueOf(XmlElement xml)
          XML factory method.
 
Methods inherited from class com.dautelle.math.numbers.RealtimeNumber
clone, export, isLocalObject, isPoolObject, pow, recycle, toHeap
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Float64 ZERO
The 64 bits floating point representing zero.


ONE

public static final Float64 ONE
The 64 bits float one.

Method Detail

valueOf

public static Float64 valueOf(double doubleValue)
Returns the 64 bits float of specified double value.

Parameters:
doubleValue - the double value for this number.
Returns:
the corresponding number.
See Also:
doubleValue()

valueOf

public static Float64 valueOf(java.lang.CharSequence chars)
Returns the number for the specified character sequence.

Parameters:
chars - the character sequence.
Returns:
the corresponding number.

valueOf

public static Float64 valueOf(XmlElement xml)
XML factory method.

Parameters:
xml - the XML element describing the number to return (e.g. <math:Float64 value="0.0"/>).
Returns:
a new number as described by the specified xml element.

isInfinite

public boolean isInfinite()
Indicates if this number is infinite.

Returns:
true if this number is infinite; false otherwise.

isNaN

public boolean isNaN()
Indicates if this number is not a number.

Returns:
true if this number is NaN; false otherwise.

negate

public Float64 negate()
Returns the negation of this number.

Returns:
-this.

add

public Float64 add(Float64 that)
Returns the sum of this number with the one specified.

Parameters:
that - the number to be added.
Returns:
this + that.

subtract

public Float64 subtract(Float64 that)
Returns the difference between this number and the one specified.

Parameters:
that - the number to be subtracted.
Returns:
this - that.

multiply

public Float64 multiply(Float64 that)
Returns the product of this number with the one specified.

Parameters:
that - the number multiplier.
Returns:
this * that.

inverse

public Float64 inverse()
Returns the inverse of this number.

Returns:
1 / this.

divide

public Float64 divide(Float64 that)
Returns this number divided by the one specified.

Parameters:
that - the number divisor.
Returns:
this / that.

abs

public Float64 abs()
Returns the absolute value of this number.

Returns:
abs(this).

sqrt

public Float64 sqrt()
Returns the positive square root of this number.

Returns:
sqrt(this).

exp

public Float64 exp()
Returns the exponential number e raised to the power of this number.

Returns:
exp(this).

log

public Float64 log()
Returns the natural logarithm (base e) of this number.

Returns:
log(this).

pow

public Float64 pow(double e)
Returns this number raised to the specified power.

Parameters:
e - the exponent.
Returns:
this**e.

pow

public Float64 pow(Float64 that)
Returns this number raised to the power of the specified exponent.

Parameters:
that - the exponent.
Returns:
this**that.

appendTo

public java.lang.StringBuffer appendTo(java.lang.StringBuffer sb)
Appends the decimal text representation of this number to the StringBuffer argument.

Parameters:
sb - the StrinBuffer to append.
Returns:
the specified StrinBuffer.

toString

public java.lang.String toString()
Returns the decimal text representation of this number.

Returns:
the text representation of this number.

equals

public boolean equals(java.lang.Object that)
Compares this number against the specified object.

Parameters:
that - the object to compare with.
Returns:
true if the objects are the same; false otherwise.

hashCode

public int hashCode()
Returns the hash code for this number.

Returns:
the hash code value.

intValue

public int intValue()
Returns the value of this number as an int.

Returns:
the int value.

longValue

public long longValue()
Returns the value of this number as a long.

Returns:
the long value.

floatValue

public float floatValue()
Returns the value of this number as a float.

Returns:
the float value.

doubleValue

public double doubleValue()
Returns the value of this number as a double.

Returns:
the double value.

compareTo

public int compareTo(Float64 that)
Compares two 64 bits float numerically.

Parameters:
that - the number to compare with.
Returns:
-1, 0 or 1 as this number is numerically less than, equal to, or greater than that.

compareTo

public int compareTo(java.lang.Object that)
Specified by:
compareTo in interface java.lang.Comparable

plus

public Operable plus(Operable that)
Description copied from interface: Operable
Returns the sum of this object with the one specified.

Specified by:
plus in interface Operable
Parameters:
that - the object to be added.
Returns:
this + that.

opposite

public Operable opposite()
Description copied from interface: Operable
Returns the additive inverse of this object. It is the object such as this.plus(this.opposite()) == ZERO, with ZERO being the additive identity.

Specified by:
opposite in interface Operable
Returns:
-this.

times

public Operable times(Operable that)
Description copied from interface: Operable
Returns the product of this object with the one specified.

Specified by:
times in interface Operable
Parameters:
that - the object multiplier.
Returns:
this * that.

reciprocal

public Operable reciprocal()
Description copied from interface: Operable
Returns the multiplicative inverse of this object. It it the object such as this.times(this.reciprocal()) == ONE , with ONE being the multiplicative identity.

Specified by:
reciprocal in interface Operable
Returns:
ONE / this.

toXml

public void toXml(XmlElement xml)
Description copied from interface: Representable
Sets the attributes and content of the XML element corresponding to this object.

Specified by:
toXml in interface Representable
Parameters:
xml - the XML element to set according to this object's desired XML representation.

JADE v6.1

Copyright © 2004 Jean-Marie Dautelle.