[Open all] [Close all] [Open all source code] [Close all source code]

The HumNum class manages data conversions for the humlib library.


HumNum Public functions

HumNum — HumNum Constructor.
getAbs — returns the absolute value of the rational number.
getDenominator — Returns the bottom integer in the fraction.
getFloat — Returns the floating-point equivalent of the rational number.
getInteger — Returns the integral part of the fraction.
getNumerator — Returns the top integer in the fraction.
getRemainder — Returns the non-integer fractional part of the value.
isFinite — Returns true if the denominator is not zero.
isInfinite — Returns true if the denominator is zero.
isInteger — Returns true if number is an integer.
isNaN — Returns true if the numerator and denominator are both zero.
isNegative — Returns true if value is negative.
isNonNegative — Returns true if value is non-negative.
isNonPositive — Returns true if value is non-positive.
isNonZero — Returns true if value is not zero.
isPositive — Returns true if value is positive.
isZero — Returns true if value is zero.
makeAbs — Make the rational number non-negative.
operatorBANGEQUAL — Inequality test for HumNums compared to other HumNums, integers or floats.
operatorDASH — Subtraction operator to subtract HumNums from each other and to subtrack integers from HumNums.
operatorDASHEQUAL — Subtract a HumNum or an integer from a HumNum.
operatorEQUAL — Assign the contents of a HumNum from another HumNum.
operatorEQUALEQUAL — Equality test for HumNums compared to another HumNum, integer or float.
operatorGREAT — Greater-than equality for a HumNum compared to a HumNum, integer, or float.
operatorGREATEQUAL — Greater-than-or-equal equality comparison for a HumNum to another HumNum, integer, or float.
operatorLESS — Less-than equality for a HumNum and a HumNum, integer, or float.
operatorLESSEQUAL — Less-than-or-equal equality for a HumNum with a HumNum, integer or float.
operatorPLUS — Addition operator which adds HumNum to another HumNum or with a integers.
operatorPLUSEQUAL — Add a HumNum or integer to a HumNum.
operatorSLASH — Division operator to divide two HumNums together or divide a HumNum by an integer.
operatorSLASHEQUAL — Divide a HumNum by a HumNum or integer.
operatorSTAR — Multiplication operator to multiply two HumNums together or a HumNum and an integer.
operatorSTAREQUAL — Multiply a HumNum by a HumNum or integer.
printFraction — Print HumNum as a fraction, such as 3/2.
printList — Print as a list of two numbers, such as "(1, 2)" for 1/2.
printMixedFraction — Print as an integer plus fractional remainder.
setValue — Set the number to the given integer.