Package org.jscience.mathematics.number
Class Float64
- All Implemented Interfaces:
Serializable,Comparable<Float64>,javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,javolution.xml.XMLSerializable,Field<Float64>,GroupAdditive<Float64>,GroupMultiplicative<Float64>,Ring<Float64>,Structure<Float64>
This class represents a 64 bits floating point number.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabs()Returns the absolute value of this number.intcompareTo(double value) Compares this number with the specified value for order.intCompares this number with the specified number for order.copy()Returns a copy of this numberallocatedby the calling thread (possibly on the stack).divide(double value) Returns this number divided by the specified value.Returns this number divided by the one specified.doubleReturns the value of this number as adouble.booleanequals(double value) Indicates if this number is equal to the specified value.booleanCompares this number against the specified object.exp()Returns the exponential number e raised to the power of this number.inthashCode()Returns the hash code for this number.inverse()Returns the reciprocal of this number.booleanIndicates if this number is infinite.booleanisLargerThan(Float64 that) Compares the absolute value of this number with that number.booleanisNaN()Indicates if this number is not a number.log()Returns the natural logarithm (base e) of this number.longReturns the value of this number as along.minus(double value) Returns the difference between this number and the specified value.Returns the difference between this number and the one specified.opposite()Returns the opposite of this number.plus(double value) Returns the sum of this number with the specified value.Returns the sum of this number with the one specified.pow(double e) Returns this number raised to the specified power.Returns this number raised to the power of the specified exponent.longround()Returns the closest integer value to this 64 bits floating point number.sqrt()Returns the positive square root of this number.times(double value) Returns the product of this number with the specified value.Returns the product of this number with the one specified.javolution.text.TexttoText()Returns the decimal text representation of this number.static Float64valueOf(double doubleValue) Returns the 64 bits float from the specifieddoublevalue.static Float64valueOf(CharSequence chars) Returns the number for the specified character sequence.Methods inherited from class org.jscience.mathematics.number.Number
byteValue, floatValue, intValue, isGreaterThan, isLessThan, pow, shortValue, toString
-
Field Details
-
ZERO
The 64 bits floating point representing zero. -
ONE
The 64 bits floating point representing one.
-
-
Method Details
-
valueOf
Returns the 64 bits float from the specifieddoublevalue.- Parameters:
doubleValue- thedoublevalue for this number.- Returns:
- the corresponding number.
- See Also:
-
valueOf
Returns the number for the specified character sequence.- Parameters:
chars- the character sequence.- Returns:
- the corresponding number.
-
isInfinite
public boolean isInfinite()Indicates if this number is infinite.- Returns:
trueif this number is infinite;falseotherwise.
-
isNaN
public boolean isNaN()Indicates if this number is not a number.- Returns:
trueif this number is NaN;falseotherwise.
-
round
public long round()Returns the closest integer value to this 64 bits floating point number.- Returns:
- this number rounded to the nearest integer.
-
opposite
Returns the opposite of this number.- Specified by:
oppositein interfaceGroupAdditive<Float64>- Returns:
-this.
-
plus
Returns the sum of this number with the one specified.- Specified by:
plusin interfaceGroupAdditive<Float64>- Parameters:
that- the number to be added.- Returns:
this + that.
-
plus
Returns the sum of this number with the specified value.- Parameters:
value- the value to be added.- Returns:
this + value.
-
minus
Returns the difference between this number and the one specified. -
minus
Returns the difference between this number and the specified value.- Parameters:
value- the value to be subtracted.- Returns:
this - value.
-
times
Returns the product of this number with the one specified. -
times
Returns the product of this number with the specified value.- Parameters:
value- the value multiplier.- Returns:
this · value.
-
inverse
Returns the reciprocal of this number.- Specified by:
inversein interfaceGroupMultiplicative<Float64>- Returns:
1 / this.
-
divide
Returns this number divided by the one specified.- Parameters:
that- the number divisor.- Returns:
this / that.
-
divide
Returns this number divided by the specified value.- Parameters:
value- the value divisor.- Returns:
this / value.
-
isLargerThan
Compares the absolute value of this number with that number.- Specified by:
isLargerThanin classNumber<Float64>- Parameters:
that- the number to compare with.- Returns:
|this| > |that|
-
abs
Returns the absolute value of this number.- Returns:
|this|.
-
sqrt
Returns the positive square root of this number.- Returns:
sqrt(this).
-
exp
Returns the exponential number e raised to the power of this number.- Returns:
exp(this).
-
log
Returns the natural logarithm (base e) of this number.- Returns:
log(this).
-
pow
Returns this number raised to the power of the specified exponent.- Parameters:
that- the exponent.- Returns:
this**that.
-
pow
Returns this number raised to the specified power.- Parameters:
e- the exponent.- Returns:
this**e.
-
toText
public javolution.text.Text toText()Returns the decimal text representation of this number. -
equals
Compares this number against the specified object. -
equals
public boolean equals(double value) Indicates if this number is equal to the specified value.- Parameters:
value- the value to compare with.- Returns:
this.doubleValue() == value.
-
compareTo
public int compareTo(double value) Compares this number with the specified value for order.- Parameters:
value- the value to be compared with.- Returns:
- a negative integer, zero, or a positive integer as this number is less than, equal to, or greater than the specified value.
-
hashCode
public int hashCode()Returns the hash code for this number. -
longValue
public long longValue()Description copied from class:NumberReturns the value of this number as along. -
doubleValue
public double doubleValue()Description copied from class:NumberReturns the value of this number as adouble.- Specified by:
doubleValuein classNumber<Float64>- Returns:
- the numeric value represented by this object after conversion
to type
double.
-
compareTo
Description copied from class:NumberCompares this number with the specified number for order. Returns a negative integer, zero, or a positive integer as this number is less than, equal to, or greater than the specified number. Implementation must ensure that this method is consistent with equals(x.compareTo(y)==0) == (x.equals(y)), -
copy
Description copied from class:NumberReturns a copy of this numberallocatedby the calling thread (possibly on the stack).
-