Even, Odd Functions

Purpose

Even tests if a numeric expression is even and returns -1 (true) if it is, or 0 if the expression is odd, while Odd tests if a numeric expression is odd and returns -1 (true) if it is, or 0 if the expression is even.

Syntax

Even(x)

Odd(x)

x:aexp

Example

OpenW # 1

Local x = 6

Print "The value of x is "; x; "which is " & (Even(x) ? "even." : "odd.")

x = 3

Print "The value of x is "; x; "which is " & (Odd(x) ? "odd." : "even.")

See Also

Odd()

{Created by Sjouke Hamstra; Last updated: 04/10/2014 by James Gaite}