Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
RealNumber
objects.
Method Summary | |
RealNumber | add(RealNumber a,
RealNumber b)
Computes the sum of the arguments. |
RationalNumber | createFraction(long numerator,
long denominator)
Returns a fraction with the given numerator and denominator, both being a long . |
RationalNumber | createFraction(IntegerNumber numerator,
IntegerNumber denominator)
Returns a fraction with the given numerator and denominator. |
IntegerNumber | createInteger(byte[] bytes)
Returns an integer number from a byte array in two's complement notation. |
IntegerNumber | createRandomInteger(int maxBytes)
Returns a pseudo-random IntegerNumber of at maximum
maxBytes bytes. |
RealNumber | multiply(RealNumber a,
RealNumber b)
Computes the product of the arguments. |
RealNumber | pow(RealNumber base,
RealNumber exponent)
Computes the power for the given base and exponent. |
RationalNumber | valueOf(double n)
Returns a rational number from the given double . |
IntegerNumber | valueOf(long n)
Returns a rational number from the given long . |
IntegerNumber | valueOf(java.math.BigInteger n)
Converts a java.math. |
RationalNumber | valueOf(java.math.BigDecimal n)
Converts a java.math. |
RealNumber | valueOf(java.lang.String s)
Converts a String to a RealNumber . |
Method Detail |
public RealNumber add(RealNumber a, RealNumber b) throws java.lang.IllegalArgumentException
a
- the first operand.
b
- the second operand.null
null
public RealNumber multiply(RealNumber a, RealNumber b) throws java.lang.IllegalArgumentException
a
- the first operand.
b
- the second operand.null
null
public RealNumber pow(RealNumber base, RealNumber exponent) throws java.lang.IllegalArgumentException, java.lang.ArithmeticException
base
- the base for the power.
exponent
- the exponent for the power.null
null
public RationalNumber createFraction(long numerator, long denominator) throws java.lang.ArithmeticException
long
.
numerator
- the numerator for the fraction.
denominator
- the denominator for the fraction.public RationalNumber createFraction(IntegerNumber numerator, IntegerNumber denominator) throws java.lang.IllegalArgumentException, java.lang.ArithmeticException
numerator
- the numerator for the fraction.
denominator
- the denominator for the fraction.null
null
public IntegerNumber createInteger(byte[] bytes) throws java.lang.IllegalArgumentException
bytes
- the two's complement byte array.null
public RationalNumber valueOf(double n) throws java.lang.IllegalArgumentException
double
.
n
- the original value.RealNumber
.public IntegerNumber valueOf(long n)
long
.
n
- the original value.RealNumber
.public IntegerNumber valueOf(java.math.BigInteger n) throws java.lang.IllegalArgumentException
java.math.BigInteger
to an
IntegerNumber
.
n
- the BigInteger
to convert.null
.public RationalNumber valueOf(java.math.BigDecimal n) throws java.lang.IllegalArgumentException
java.math.BigDecimal
to a
RationalNumber
.
n
- the BigDecimal
to convert.null
.public RealNumber valueOf(java.lang.String s) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException
String
to a RealNumber
.
s
- the string to parse.RealNumber
, on success.public IntegerNumber createRandomInteger(int maxBytes) throws java.lang.IllegalArgumentException
IntegerNumber
of at maximum
maxBytes
bytes. The returned integer number will have a
value between -2maxBytes*8 and
(2maxBytes-1).Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |