Package gnu.math
Class IntFraction
- All Implemented Interfaces:
Externalizable,Serializable,Comparable
Implementation of exact rational numbers a ratio of two IntNums.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn this + k * obj.addReversed(Numeric x, int k) Calculatex+k&this.final intReturn an integer for which ofthisorobjis larger.intfinal IntNumdoubleThe value of the real component, as a double.final booleanlongneg()static IntFractionneg(IntFraction x) final IntNumvoidfinal intsign()Return 1 if>0; 0 if==0; -1 if<0; -2 ifNaN.toString(int radix) voidMethods inherited from class gnu.math.RatNum
add, asRatNumOrNull, classifyFinite, compare, divide, equals, equals, infinity, isExact, isZero, make, neg, power, rationalize, rneg, times, toExact, toExactInt, toInt, valueOfMethods inherited from class gnu.math.RealNum
abs, add, angle, asBigDecimal, asRealNumOrNull, compareTo, conjugate, cos, divide, exp, im, isReal, log, max, min, re, sin, sqrt, tan, times, toExactInt, toExactInt, toInexact, toInt, toScaledInt, toScaledInt, toScaledInt, toStringDecimal, toStringScientific, toStringScientific, toStringScientific, toStringScientific, unitQuaternion, unitVector, vectorPartMethods inherited from class gnu.math.Complex
add, colatitude, compare, complexPart, divide, equals, imMinusOne, imOne, jm, km, longitude, make, make, neg, polar, polar, power, timesMethods inherited from class gnu.math.Quaternion
add, compare, divide, doubleImagValue, doubleJmagValue, doubleKmagValue, doubleRealValue, equals, jmMinusOne, jmOne, kmMinusOne, kmOne, make, make, neg, number, polar, polar, power, timesMethods inherited from class gnu.math.Quantity
add, compare, dimensions, divide, imValue, jmValue, kmValue, make, make, make, reValue, times, unitMethods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, floatValue, geq, grt, intValue, mul_ident, sub, toStringMethods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
IntFraction
-
-
Method Details
-
numerator
-
denominator
- Specified by:
denominatorin classRatNum
-
isNegative
public final boolean isNegative()- Specified by:
isNegativein classRealNum
-
sign
public final int sign()Description copied from class:RealNumReturn 1 if>0; 0 if==0; -1 if<0; -2 ifNaN. -
compare
Description copied from class:NumericReturn an integer for which ofthisorobjis larger. Return 1 ifthis>obj; 0 ifthis==obj; -1 ifthis<obj; -2 ifthis!=objotherwise (for example if either is NaN); -3 if not comparable (incompatible types). -
compareReversed
- Overrides:
compareReversedin classQuantity
-
add
Description copied from class:NumericReturn this + k * obj. -
addReversed
Description copied from class:NumericCalculatex+k&this.- Overrides:
addReversedin classComplex
-
mul
-
mulReversed
- Overrides:
mulReversedin classComplex
-
div
-
divReversed
- Overrides:
divReversedin classComplex
-
neg
-
neg
-
longValue
public long longValue()- Overrides:
longValuein classQuaternion
-
doubleValue
public double doubleValue()Description copied from class:QuantityThe value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleValuein classQuaternion
-
toString
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-