$isodd

Tests if a number is odd.

Syntax

$isodd(expression)

Parameters

expression

a number, or an expression that evaluates to a number

Return Value

If expression evaluates to an odd number, the function returns "1" ($True); if expression evaluates to an even number, the function returns"0" ($False)

If expression does not evaluate to a number, the software raises an error.  The function returns "0" ($False).

Comments

Expression is rounded before testing.

Example

$isodd(vAmount)=$False

Evaluates to $True if vAmount is even.

$isodd(-5)

Evaluates to $True.

$isodd(Salary*1.1)

Evaluates to $False if Salary is 20,000.

$isodd("123.4")

Evaluates to $True.

$isodd("abc")

Evaluates to $False.

 

Related Topics