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, shortValuepublic RationalNumber negate()
public double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic String toDisplayString()
public static RationalNumber valueOf(double value)
value - rational number double valueCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.