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

Previous Odd Function
Math Arithmetic Class

Public Function PreviousOdd( _
    ByVal vX As Variant _
    ) As Variant

"Previous Odd Number"
Returns the next smaller odd number.

Examples:
    PreviousOdd(0) = -1
    PreviousOdd(1) = -1
    PreviousOdd(2) = 1
    PreviousOdd(45) = 43
    PreviousOdd(22.4) = 21
    PreviousOdd(-1.7) = -3
    PreviousOdd(-6.5) = -7
    PreviousOdd(-7.8) = -9
See also:
    PreviousOddSample Subroutine
    PreviousEven Function
    PreviousNumber Function
    NextOdd Function
vX: Number which is rounded-down to the previous odd number (i.e. 1, 3, 5, -1, -3, -5, etc.). Function returns Null if vX is Null or cannot be fixed up to a number.
Note: Similar to calling the Floor function with a precision of 2 (two) and an offset of 1 (one), except that if vX is already an odd number, this function returns the previous odd number.

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