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 bytebyteValue()Rationaldivide(double det)doubledoubleValue()floatfloatValue()RationalgetReciprocal()intintValue()booleanisInteger()longlongValue()static Rationalof(double d)static Rationalof(int i)shortshortValue()java.lang.StringtoString()
-
-
-
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:
doubleValuein classjava.lang.Number
-
floatValue
public float floatValue()
- Specified by:
floatValuein classjava.lang.Number
-
byteValue
public byte byteValue()
- Overrides:
byteValuein classjava.lang.Number
-
intValue
public int intValue()
- Specified by:
intValuein classjava.lang.Number
-
longValue
public long longValue()
- Specified by:
longValuein classjava.lang.Number
-
shortValue
public short shortValue()
- Overrides:
shortValuein 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:
toStringin classjava.lang.Object
-
-