613-518-1166 info@zimdatabases.com

ZIM Language Reference

$isodd

< All Topics

$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.

 

See Also

$isnumber

About Functional Expressions

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents