Package it.tidalwave.image
Class Rational
- java.lang.Object
-
- java.lang.Number
-
- it.tidalwave.image.Rational
-
- All Implemented Interfaces:
java.io.Serializable
@Immutable public final class Rational extends java.lang.Number
- Author:
- Fabrizio Giudici
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Rational()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
byteValue()
Rational
divide(double det)
double
doubleValue()
float
floatValue()
Rational
getReciprocal()
int
intValue()
boolean
isInteger()
long
longValue()
static Rational
of(double d)
static Rational
of(int i)
short
shortValue()
java.lang.String
toString()
-
-
-
Method Detail
-
of
@Nonnull public static Rational of(int i)
- Parameters:
i
-
-
of
@Nonnull public static Rational of(double d)
- Parameters:
d
-
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classjava.lang.Number
-
byteValue
public byte byteValue()
- Overrides:
byteValue
in classjava.lang.Number
-
intValue
public int intValue()
- Specified by:
intValue
in classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValue
in classjava.lang.Number
-
shortValue
public short shortValue()
- Overrides:
shortValue
in classjava.lang.Number
-
divide
@Nonnull public Rational divide(double det)
- Parameters:
det
-- Returns:
-
getReciprocal
@Nonnull public Rational getReciprocal()
-
isInteger
public boolean isInteger()
-
toString
@Nonnull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-