gnu.math
Class IntFraction
java.lang.Object
   java.lang.Number
java.lang.Number
       gnu.math.Numeric
gnu.math.Numeric
           gnu.math.Quantity
gnu.math.Quantity
               gnu.math.Complex
gnu.math.Complex
                   gnu.math.RealNum
gnu.math.RealNum
                       gnu.math.RatNum
gnu.math.RatNum
                           gnu.math.IntFraction
gnu.math.IntFraction
- All Implemented Interfaces: 
- java.io.Externalizable, java.io.Serializable, java.lang.Comparable
- public class IntFraction 
- extends RatNum- implements java.io.Externalizable
Implementation of exact rational numbers a ratio of two IntNums.
- See Also:
- Serialized Form
 
 
 
 
| Methods inherited from class gnu.math.RatNum | 
| add, compare, divide, equals, equals, infinity, isExact, isZero, make, power, rationalize, times, toExact, toExactInt, toInt | 
 
| Methods inherited from class gnu.math.RealNum | 
| abs, add, compareTo, divide, exp, im, log, max, min, re, rneg, sin, sqrt, times, toExactInt, toExactInt, toInt, toScaledInt, toScaledInt, toScaledInt | 
 
| Methods inherited from class gnu.math.Complex | 
| add, angle, compare, divide, doubleImagValue, doubleRealValue, equals, imMinusOne, imOne, make, make, neg, number, polar, polar, power, times | 
 
| Methods inherited from class gnu.math.Quantity | 
| add, compare, dimensions, divide, imValue, make, make, make, reValue, times, unit | 
 
 
| Methods inherited from class java.lang.Number | 
| byteValue, shortValue | 
 
| Methods inherited from class java.lang.Object | 
| clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
 
IntFraction
public IntFraction(IntNum num,
                   IntNum den)
numerator
public final IntNum numerator()
- 
- Specified by:
- numeratorin class- RatNum
 
- 
 
denominator
public final IntNum denominator()
- 
- Specified by:
- denominatorin class- RatNum
 
- 
 
isNegative
public final boolean isNegative()
- 
- Specified by:
- isNegativein class- RealNum
 
- 
 
sign
public final int sign()
- Description copied from class: RealNum
- Return 1 if >0; 0 if ==0; -1 if <0; -2 if NaN.
 
- 
- Specified by:
- signin class- RealNum
 
- 
 
compare
public final int compare(java.lang.Object obj)
- Description copied from class: Numeric
- Return 1 if this>obj; 0 if this==obj; -1 if this
- 
- Overrides:
- comparein class- Complex
 
- 
 
compareReversed
public int compareReversed(Numeric x)
- 
- Overrides:
- compareReversedin class- Quantity
 
- 
 
add
public Numeric add(java.lang.Object y,
                   int k)
- Description copied from class: Numeric
- Return this + k * obj.
 
- 
- Specified by:
- addin class- RealNum
 
- 
 
addReversed
public Numeric addReversed(Numeric x,
                           int k)
- Description copied from class: Numeric
- Calculate x+k&this.
 
- 
- Overrides:
- addReversedin class- Complex
 
- 
 
mul
public Numeric mul(java.lang.Object y)
- 
- Specified by:
- mulin class- RealNum
 
- 
 
mulReversed
public Numeric mulReversed(Numeric x)
- 
- Overrides:
- mulReversedin class- Complex
 
- 
 
div
public Numeric div(java.lang.Object y)
- 
- Specified by:
- divin class- RealNum
 
- 
 
divReversed
public Numeric divReversed(Numeric x)
- 
- Overrides:
- divReversedin class- Complex
 
- 
 
neg
public static IntFraction neg(IntFraction x)
- 
 
- 
 
neg
public Numeric neg()
- 
- Overrides:
- negin class- Complex
 
- 
 
longValue
public long longValue()
- 
- Overrides:
- longValuein class- Complex
 
- 
 
doubleValue
public double doubleValue()
- Description copied from class: Quantity
- The value of the real component, as a double.
 This is relative to the unit().dims - i.e. unit()/doubleValue()
 is factored in.
 
- 
- Overrides:
- doubleValuein class- Complex
 
- 
 
toString
public java.lang.String toString(int radix)
- 
- Overrides:
- toStringin class- Complex
 
- 
 
writeExternal
public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
- 
- Specified by:
- writeExternalin interface- java.io.Externalizable
 
- 
- Throws:
- java.io.IOException
 
readExternal
public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
- 
- Specified by:
- readExternalin interface- java.io.Externalizable
 
- 
- Throws:
- java.io.IOException
- java.lang.ClassNotFoundException