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

Next Odd Function
Math Arithmetic Class

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

"Next Odd Number"
Returns the next larger odd number.

Examples:
    NextOdd(0) = 1
    NextOdd(1) = 3
    NextOdd(2) = 3
    NextOdd(45) = 47
    NextOdd(22.4) = 23
    NextOdd(-1.7) = -1
    NextOdd(-6.5) = -5
    NextOdd(-7.8) = -7
See also:
    NextOddSample Subroutine
    NextEven Function
    NextNumber Function
    PreviousOdd Function
vX: Number which is rounded-up to the next 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 Ceiling 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 next odd number.

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