<-- Previous || Up || Next -->

Rational Divisor Function
Math Arithmetic Class

Public Function RationalDivisor( _
    ByVal vRational As Variant _
    ) As Variant

Return the divisor of the fractional part of the floating-point number vRational.
Converts vRational to X+Y/Z (where X, Y, and X are all integers) then returns Z.

Examples:
    RationalDividend(45.75) = 3
    RationalDivisor(45.75) = 4
    RationalNumber(45.75) = 45
    RationalDividend(-45.75) = -3
    RationalDivisor(-45.75) = 4 ' #5
    RationalNumber(-45.75) = -45
See also:
    RationalDividend Function
    RationalNumber Function
    RationalToFraction Function
vRational: Function converts the fractional part of vRational to a fraction (X/Y where X & Y are integers) then returns the divisor (Y). Function returns Null if vRational is Null or cannot be fixed up to a number. Note: When vRational is an integer, this function returns a divisor of 1 (one). Note: This function will always return a positive divisor, even if vRational is negative as in example #5.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.