jsci.maths
Class MathDouble
- java.lang.Object
-
- java.lang.Number
-
- jsci.maths.MathDouble
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable, Field.Member, Ring.Member, AbelianGroup.Member, Member
public final class MathDouble extends java.lang.Number implements java.lang.Comparable, Field.Member
The MathDouble class encapsulates double numbers. Methods will automatically promote objects from subsets.- See Also:
RealField, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MathDouble(double num)Constructs a double number.MathDouble(java.lang.String s)Constructs the double number represented by a string.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static MathDoubleacos(double x)static MathDoubleacos(MathDouble x)Returns the arc cosine of a number.static MathDoubleacos(java.lang.Number x)static MathDoubleacosh(double x)static MathDoubleacosh(MathDouble x)Returns the arc hyperbolic cosine of a number.static MathDoubleacosh(java.lang.Number x)AbelianGroup.Memberadd(AbelianGroup.Member n)Returns the addition of this number and another.MathDoubleadd(double y)MathDoubleadd(MathDouble n)Returns the addition of this double number and another.static MathDoubleasin(double x)static MathDoubleasin(MathDouble x)Returns the arc sine of a number.static MathDoubleasin(java.lang.Number x)static MathDoubleasinh(double x)static MathDoubleasinh(MathDouble x)Returns the arc hyperbolic sine of a number.static MathDoubleasinh(java.lang.Number x)static MathDoubleatan(double x)static MathDoubleatan(MathDouble x)Returns the arc tangent of a number.static MathDoubleatan(java.lang.Number x)static MathDoubleatanh(double x)static MathDoubleatanh(MathDouble x)Returns the arc hyperbolic tangent of a number.static MathDoubleatanh(java.lang.Number x)intcompareTo(java.lang.Object obj)Compares two numbers.static MathDoublecos(double x)static MathDoublecos(MathDouble x)Returns the trigonometric cosine of an angle.static MathDoublecos(java.lang.Number x)static MathDoublecosh(double x)static MathDoublecosh(MathDouble x)Returns the hyperbolic cosine of a number.static MathDoublecosh(java.lang.Number x)MathDoubledivide(double y)Field.Memberdivide(Field.Member n)Returns the division of this number and another.MathDoubledivide(MathDouble n)Returns the division of this double number and another.doubledoubleValue()booleanequals(java.lang.Object obj)Compares two numbers for equality.booleanequals(java.lang.Object obj, double tol)static MathDoubleexp(double x)static MathDoubleexp(MathDouble x)Returns the exponential number e(2.718...) raised to the power of a number.static MathDoubleexp(java.lang.Number x)floatfloatValue()java.lang.ObjectgetSet()inthashCode()intintValue()Field.Memberinverse()Returns the inverse of this number.booleanisInfinite()Returns true if this number is infinite.booleanisNaN()Returns true if this number is NaN.static booleanisZero(double x)Returns true if the number is within the zero tolerance.static MathDoublelog(double x)static MathDoublelog(MathDouble x)Returns the natural logarithm (base e) of a number.static MathDoublelog(java.lang.Number x)longlongValue()MathDoublemultiply(double y)MathDoublemultiply(MathDouble n)Returns the multiplication of this double number and another.Ring.Membermultiply(Ring.Member n)Returns the multiplication of this number and another.AbelianGroup.Membernegate()Returns the negative of this number.static MathDoublesin(double x)static MathDoublesin(MathDouble x)Returns the trigonometric sine of an angle.static MathDoublesin(java.lang.Number x)static MathDoublesinh(double x)static MathDoublesinh(MathDouble x)Returns the hyperbolic sine of a number.static MathDoublesinh(java.lang.Number x)AbelianGroup.Membersubtract(AbelianGroup.Member n)Returns the subtraction of this number and another.MathDoublesubtract(double y)MathDoublesubtract(MathDouble n)Returns the subtraction of this double number and another.static MathDoubletan(double x)static MathDoubletan(MathDouble x)Returns the trigonometric tangent of an angle.static MathDoubletan(java.lang.Number x)static MathDoubletanh(double x)static MathDoubletanh(MathDouble x)Returns the hyperbolic tangent of a number.static MathDoubletanh(java.lang.Number x)java.lang.StringtoString()Returns a string representing the value of this double number.doublevalue()Returns the double value.
-
-
-
Constructor Detail
-
MathDouble
public MathDouble(double num)
Constructs a double number.
-
MathDouble
public MathDouble(java.lang.String s) throws java.lang.NumberFormatExceptionConstructs 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 numbers for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- a number.
-
equals
public boolean equals(java.lang.Object obj, double tol)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object obj) throws java.lang.IllegalArgumentExceptionCompares two numbers.- Specified by:
compareToin interfacejava.lang.Comparable- Parameters:
obj- a number.- Returns:
- a negative value if
this<obj, zero ifthis==obj, and a positive value ifthis>obj. - Throws:
java.lang.IllegalArgumentException
-
toString
public java.lang.String toString()
Returns a string representing the value of this double number.- Overrides:
toStringin classjava.lang.Object
-
value
public double value()
Returns the double value.
-
intValue
public int intValue()
- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValuein classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValuein classjava.lang.Number
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classjava.lang.Number
-
isZero
public static boolean isZero(double x)
Returns true if the number is within the zero tolerance.
-
isNaN
public boolean isNaN()
Returns true if this number is NaN.
-
isInfinite
public boolean isInfinite()
Returns true if this number is infinite.
-
negate
public AbelianGroup.Member negate()
Returns the negative of this number.- Specified by:
negatein interfaceAbelianGroup.Member
-
inverse
public Field.Member inverse()
Returns the inverse of this number.- Specified by:
inversein interfaceField.Member
-
add
public AbelianGroup.Member add(AbelianGroup.Member n)
Returns the addition of this number and another.- Specified by:
addin interfaceAbelianGroup.Member- Parameters:
n- a group member
-
add
public MathDouble add(MathDouble n)
Returns the addition of this double number and another.
-
add
public MathDouble add(double y)
-
subtract
public AbelianGroup.Member subtract(AbelianGroup.Member n)
Returns the subtraction of this number and another.- Specified by:
subtractin interfaceAbelianGroup.Member- Parameters:
n- a group member
-
subtract
public MathDouble subtract(MathDouble n)
Returns the subtraction of this double number and another.
-
subtract
public MathDouble subtract(double y)
-
multiply
public Ring.Member multiply(Ring.Member n)
Returns the multiplication of this number and another.- Specified by:
multiplyin interfaceRing.Member- Parameters:
n- a ring member
-
multiply
public MathDouble multiply(MathDouble n)
Returns the multiplication of this double number and another.
-
multiply
public MathDouble multiply(double y)
-
divide
public Field.Member divide(Field.Member n)
Returns the division of this number and another.- Specified by:
dividein interfaceField.Member- Parameters:
n- a field member
-
divide
public MathDouble divide(MathDouble n)
Returns the division of this double number and another.
-
divide
public MathDouble divide(double y)
-
exp
public static MathDouble exp(MathDouble x)
Returns the exponential number e(2.718...) raised to the power of a number.
-
exp
public static MathDouble exp(java.lang.Number x)
-
exp
public static MathDouble exp(double x)
-
log
public static MathDouble log(MathDouble x)
Returns the natural logarithm (base e) of a number.
-
log
public static MathDouble log(java.lang.Number x)
-
log
public static MathDouble log(double x)
-
sin
public static MathDouble sin(MathDouble x)
Returns the trigonometric sine of an angle.- Parameters:
x- an angle that is measured in radians
-
sin
public static MathDouble sin(java.lang.Number x)
-
sin
public static MathDouble sin(double x)
-
cos
public static MathDouble cos(MathDouble x)
Returns the trigonometric cosine of an angle.- Parameters:
x- an angle that is measured in radians
-
cos
public static MathDouble cos(java.lang.Number x)
-
cos
public static MathDouble cos(double x)
-
tan
public static MathDouble tan(MathDouble x)
Returns the trigonometric tangent of an angle.- Parameters:
x- an angle that is measured in radians
-
tan
public static MathDouble tan(java.lang.Number x)
-
tan
public static MathDouble tan(double x)
-
sinh
public static MathDouble sinh(MathDouble x)
Returns the hyperbolic sine of a number.
-
sinh
public static MathDouble sinh(java.lang.Number x)
-
sinh
public static MathDouble sinh(double x)
-
cosh
public static MathDouble cosh(MathDouble x)
Returns the hyperbolic cosine of a number.
-
cosh
public static MathDouble cosh(java.lang.Number x)
-
cosh
public static MathDouble cosh(double x)
-
tanh
public static MathDouble tanh(MathDouble x)
Returns the hyperbolic tangent of a number.
-
tanh
public static MathDouble tanh(java.lang.Number x)
-
tanh
public static MathDouble tanh(double x)
-
asin
public static MathDouble asin(MathDouble x)
Returns the arc sine of a number.
-
asin
public static MathDouble asin(java.lang.Number x)
-
asin
public static MathDouble asin(double x)
-
acos
public static MathDouble acos(MathDouble x)
Returns the arc cosine of a number.
-
acos
public static MathDouble acos(java.lang.Number x)
-
acos
public static MathDouble acos(double x)
-
atan
public static MathDouble atan(MathDouble x)
Returns the arc tangent of a number.
-
atan
public static MathDouble atan(java.lang.Number x)
-
atan
public static MathDouble atan(double x)
-
asinh
public static MathDouble asinh(MathDouble x)
Returns the arc hyperbolic sine of a number.
-
asinh
public static MathDouble asinh(java.lang.Number x)
-
asinh
public static MathDouble asinh(double x)
-
acosh
public static MathDouble acosh(MathDouble x)
Returns the arc hyperbolic cosine of a number.
-
acosh
public static MathDouble acosh(java.lang.Number x)
-
acosh
public static MathDouble acosh(double x)
-
atanh
public static MathDouble atanh(MathDouble x)
Returns the arc hyperbolic tangent of a number.
-
atanh
public static MathDouble atanh(java.lang.Number x)
-
atanh
public static MathDouble atanh(double x)
-
-
DMelt 3.0 © DataMelt by jWork.ORG