public class RationalNumber extends Number
Constructor and Description |
---|
RationalNumber(int numerator,
int divisor) |
Modifier and Type | Method and Description |
---|---|
double |
doubleValue() |
float |
floatValue() |
int |
intValue() |
long |
longValue() |
RationalNumber |
negate() |
String |
toDisplayString() |
String |
toString() |
static RationalNumber |
valueOf(double value)
Calculate rational number using successive approximations.
|
byteValue, shortValue
public RationalNumber negate()
public double doubleValue()
doubleValue
in class Number
public float floatValue()
floatValue
in class Number
public String toDisplayString()
public static RationalNumber valueOf(double value)
value
- rational number double valueCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.