org.jscience.mathematics.algebraic.numbers
Class Double

java.lang.Object
  extended by java.lang.Number
      extended by org.jscience.mathematics.algebraic.numbers.ComparableNumber<Double>
          extended by org.jscience.mathematics.algebraic.numbers.Double
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Double>, Field.Member, Ring.Member, AbelianGroup.Member, Member

public final class Double
extends ComparableNumber<Double>
implements java.lang.Cloneable, java.io.Serializable, Field.Member

The Double class encapsulates double numbers.

See Also:
DoubleField, Serialized Form

Field Summary
static double MAX_VALUE
          DOCUMENT ME!
static double MIN_VALUE
          DOCUMENT ME!
static double NaN
          DOCUMENT ME!
static double NEGATIVE_INFINITY
          DOCUMENT ME!
static Double ONE
          DOCUMENT ME!
static double POSITIVE_INFINITY
          DOCUMENT ME!
static java.lang.Class TYPE
          DOCUMENT ME!
static Double ZERO
          DOCUMENT ME!
 
Constructor Summary
Double(double num)
          Constructs a double number.
Double(Double num)
          Constructs a double number.
Double(float num)
          Constructs a double number.
Double(Float num)
          Constructs a double number.
Double(int num)
          Constructs a double number.
Double(Integer num)
          Constructs a double number.
Double(long num)
          Constructs a double number.
Double(Long num)
          Constructs a double number.
Double(Rational num)
          Constructs a double number.
Double(java.lang.String s)
          Constructs the double number represented by a string.
 
Method Summary
 Double abs()
          Returns the abs of this number.
static Double acos(Double x)
          Returns the arc cosine of a number.
static Double acosh(Double x)
          Returns the arc hyperbolic cosine of a number.
 AbelianGroup.Member add(AbelianGroup.Member n)
          Returns the addition of this number and another.
 Double add(Double n)
          Returns the addition of this double number and another.
static Double asin(Double x)
          Returns the arc sine of a number.
static Double asinh(Double x)
          Returns the arc hyperbolic sine of a number.
static Double atan(Double x)
          Returns the arc tangent of a number.
static Double atanh(Double x)
          Returns the arc hyperbolic tangent of a number.
 java.lang.Object clone()
          DOCUMENT ME!
 int compareTo(ComparableNumber obj)
          Compares two comparable numbers.
 int compareTo(Double obj)
          Compares two double numbers.
static Double cos(Double x)
          Returns the trigonometric cosine of an angle.
static Double cosh(Double x)
          Returns the hyperbolic cosine of a number.
 Double divide(Double n)
          Returns the division of this double number and another.
 Field.Member divide(Field.Member n)
          Returns the division of this number and another.
 double doubleValue()
          DOCUMENT ME!
 boolean equals(java.lang.Object obj)
          Compares two double numbers for equality.
static Double exp(Double x)
          Returns the exponential number e(2.718...) raised to the power of a number.
 float floatValue()
          DOCUMENT ME!
 Double getDistance(ComparableNumber n)
          DOCUMENT ME!
 Double getEpsilon()
          ‚±‚Ì•¡‘f?
 Double getNaN()
          DOCUMENT ME!
 Double getNegativeInfinity()
          DOCUMENT ME!
 Double getPositiveInfinity()
          DOCUMENT ME!
 int hashCode()
          Returns a hash code for this Double object.
 int intValue()
          DOCUMENT ME!
 Field.Member inverse()
          Returns the inverse of this number.
 boolean isInfinite()
          Returns true if this number is infinite.
 boolean isNaN()
          Returns true if this number is NaN.
 boolean isNegativeInfinity()
          DOCUMENT ME!
 boolean isPositiveInfinity()
          DOCUMENT ME!
static Double log(Double x)
          Returns the natural logarithm (base e) of a number.
 long longValue()
          DOCUMENT ME!
 Double max(Double val)
          Returns the max of this number and another, according to compareTo rules.
 Double min(Double val)
          Returns the min of this number and another, according to compareTo rules.
 Double multiply(Double n)
          Returns the multiplication of this double number and another.
 Ring.Member multiply(Ring.Member n)
          Returns the multiplication of this number and another.
 AbelianGroup.Member negate()
          Returns the negative of this number.
 int signum()
          Returns the sign of this number.
static Double sin(Double x)
          Returns the trigonometric sine of an angle.
static Double sinh(Double x)
          Returns the hyperbolic sine of a number.
 AbelianGroup.Member subtract(AbelianGroup.Member n)
          Returns the subtraction of this number and another.
 Double subtract(Double n)
          Returns the subtraction of this double number and another.
static Double tan(Double x)
          Returns the trigonometric tangent of an angle.
static Double tanh(Double x)
          Returns the hyperbolic tangent of a number.
 java.lang.String toString()
          Returns a string representing the value of this double number.
 double value()
          Returns the double value.
 
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 Double ZERO
DOCUMENT ME!


ONE

public static final Double ONE
DOCUMENT ME!


MAX_VALUE

public static final double MAX_VALUE
DOCUMENT ME!

See Also:
Constant Field Values

MIN_VALUE

public static final double MIN_VALUE
DOCUMENT ME!

See Also:
Constant Field Values

NaN

public static final double NaN
DOCUMENT ME!

See Also:
Constant Field Values

NEGATIVE_INFINITY

public static final double NEGATIVE_INFINITY
DOCUMENT ME!

See Also:
Constant Field Values

POSITIVE_INFINITY

public static final double POSITIVE_INFINITY
DOCUMENT ME!

See Also:
Constant Field Values

TYPE

public static final java.lang.Class TYPE
DOCUMENT ME!

Constructor Detail

Double

public Double(double num)
Constructs a double number.


Double

public Double(float num)
Constructs a double number.


Double

public Double(long num)
Constructs a double number.


Double

public Double(int num)
Constructs a double number.


Double

public Double(Double num)
Constructs a double number.


Double

public Double(Float num)
Constructs a double number.


Double

public Double(Rational num)
Constructs a double number.


Double

public Double(Long num)
Constructs a double number.


Double

public Double(Integer num)
Constructs a double number.


Double

public Double(java.lang.String s)
       throws java.lang.NumberFormatException
Constructs the double number represented by a string.

Parameters:
s - a string representing a double number.
Throws:
java.lang.NumberFormatException - if the string does not contain a parsable number.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares two double numbers for equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj - a double number.
Returns:
DOCUMENT ME!

compareTo

public int compareTo(ComparableNumber obj)
              throws java.lang.IllegalArgumentException
Compares two comparable numbers.

Parameters:
obj - a number.
Returns:
a negative value if this<obj, zero if this==obj, and a positive value if this>obj.
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

compareTo

public int compareTo(Double obj)
Compares two double numbers.

Specified by:
compareTo in interface java.lang.Comparable<Double>
Parameters:
obj - a double number.
Returns:
a negative value if this<obj, zero if this==obj, and a positive value if this>obj.

toString

public java.lang.String toString()
Returns a string representing the value of this double number.

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

value

public double value()
Returns the double value.

Returns:
DOCUMENT ME!

intValue

public int intValue()
DOCUMENT ME!

Specified by:
intValue in class java.lang.Number
Returns:
DOCUMENT ME!

longValue

public long longValue()
DOCUMENT ME!

Specified by:
longValue in class java.lang.Number
Returns:
DOCUMENT ME!

floatValue

public float floatValue()
DOCUMENT ME!

Specified by:
floatValue in class java.lang.Number
Returns:
DOCUMENT ME!

doubleValue

public double doubleValue()
DOCUMENT ME!

Specified by:
doubleValue in class java.lang.Number
Returns:
DOCUMENT ME!

abs

public Double abs()
Returns the abs of this number.

Returns:
DOCUMENT ME!

signum

public int signum()
Returns the sign of this number.

Returns:
DOCUMENT ME!

min

public Double min(Double val)
Returns the min of this number and another, according to compareTo rules.

Overrides:
min in class ComparableNumber<Double>
Parameters:
val - DOCUMENT ME!
Returns:
DOCUMENT ME!

max

public Double max(Double val)
Returns the max of this number and another, according to compareTo rules.

Overrides:
max in class ComparableNumber<Double>
Parameters:
val - DOCUMENT ME!
Returns:
DOCUMENT ME!

isNaN

public boolean isNaN()
Returns true if this number is NaN.

Specified by:
isNaN in class ComparableNumber<Double>
Returns:
DOCUMENT ME!

isInfinite

public boolean isInfinite()
Returns true if this number is infinite.

Specified by:
isInfinite in class ComparableNumber<Double>
Returns:
DOCUMENT ME!

isNegativeInfinity

public boolean isNegativeInfinity()
DOCUMENT ME!

Specified by:
isNegativeInfinity in class ComparableNumber<Double>
Returns:
DOCUMENT ME!

isPositiveInfinity

public boolean isPositiveInfinity()
DOCUMENT ME!

Specified by:
isPositiveInfinity in class ComparableNumber<Double>
Returns:
DOCUMENT ME!

getNaN

public Double getNaN()
DOCUMENT ME!

Specified by:
getNaN in class ComparableNumber<Double>
Returns:
DOCUMENT ME!

getNegativeInfinity

public Double getNegativeInfinity()
DOCUMENT ME!

Specified by:
getNegativeInfinity in class ComparableNumber<Double>
Returns:
DOCUMENT ME!

getPositiveInfinity

public Double getPositiveInfinity()
DOCUMENT ME!

Specified by:
getPositiveInfinity in class ComparableNumber<Double>
Returns:
DOCUMENT ME!

hashCode

public int hashCode()
Returns a hash code for this Double object.

Overrides:
hashCode in class java.lang.Object
Returns:
DOCUMENT ME!

getDistance

public Double getDistance(ComparableNumber n)
DOCUMENT ME!

Specified by:
getDistance in class ComparableNumber<Double>
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

negate

public AbelianGroup.Member negate()
Returns the negative of this number.

Specified by:
negate in interface AbelianGroup.Member
Returns:
DOCUMENT ME!

inverse

public Field.Member inverse()
Returns the inverse of this number.

Specified by:
inverse in interface Field.Member
Returns:
DOCUMENT ME!

add

public AbelianGroup.Member add(AbelianGroup.Member n)
Returns the addition of this number and another.

Specified by:
add in interface AbelianGroup.Member
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

add

public Double add(Double n)
Returns the addition of this double number and another.

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

subtract

public AbelianGroup.Member subtract(AbelianGroup.Member n)
Returns the subtraction of this number and another.

Specified by:
subtract in interface AbelianGroup.Member
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

subtract

public Double subtract(Double n)
Returns the subtraction of this double number and another.

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

multiply

public Ring.Member multiply(Ring.Member n)
Returns the multiplication of this number and another.

Specified by:
multiply in interface Ring.Member
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

multiply

public Double multiply(Double n)
Returns the multiplication of this double number and another.

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

divide

public Field.Member divide(Field.Member n)
Returns the division of this number and another.

Specified by:
divide in interface Field.Member
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

divide

public Double divide(Double n)
Returns the division of this double number and another.

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

exp

public static Double exp(Double x)
Returns the exponential number e(2.718...) raised to the power of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

log

public static Double log(Double x)
Returns the natural logarithm (base e) of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

sin

public static Double sin(Double x)
Returns the trigonometric sine of an angle.

Parameters:
x - an angle that is measured in radians
Returns:
DOCUMENT ME!

cos

public static Double cos(Double x)
Returns the trigonometric cosine of an angle.

Parameters:
x - an angle that is measured in radians
Returns:
DOCUMENT ME!

tan

public static Double tan(Double x)
Returns the trigonometric tangent of an angle.

Parameters:
x - an angle that is measured in radians
Returns:
DOCUMENT ME!

sinh

public static Double sinh(Double x)
Returns the hyperbolic sine of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

cosh

public static Double cosh(Double x)
Returns the hyperbolic cosine of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

tanh

public static Double tanh(Double x)
Returns the hyperbolic tangent of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

asin

public static Double asin(Double x)
Returns the arc sine of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

acos

public static Double acos(Double x)
Returns the arc cosine of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

atan

public static Double atan(Double x)
Returns the arc tangent of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

asinh

public static Double asinh(Double x)
Returns the arc hyperbolic sine of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

acosh

public static Double acosh(Double x)
Returns the arc hyperbolic cosine of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

atanh

public static Double atanh(Double x)
Returns the arc hyperbolic tangent of a number.

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

getEpsilon

public final Double getEpsilon()
‚±‚Ì•¡‘f?�?‚Ì•„?†‚ɑΉž‚µ‚½?u•¡‘f?�?‚̊ۂߌë?·?v‚ð•Ô‚·?B

Returns:
‚±‚Ì•¡‘f?�?‚Ì•„?†‚ɑΉž‚µ‚½?u•¡‘f?�?‚̊ۂߌë?·?v

clone

public java.lang.Object clone()
DOCUMENT ME!

Overrides:
clone in class java.lang.Object
Returns:
DOCUMENT ME!