odd

To return Yes (true) if the number is odd

With this function, you can check whether a number is odd, i.e. not divisible by 2 without remainder. The return value is either Yes (true) or No (false). 0 is evaluated as even, and therefore returns No (false).

Syntax

odd(number)

Return

boolean

Examples

odd(10 + 12) 

Result: No (false)

odd(10 + 13) 

Result: Yes (true)

odd(0) 

Result: No (false)

odd(10.2) 

Result: Yes (true)

See also

even which returns Yes (true) if the number is even.

Last updated