isOdd
Table of Contents
Overview
The isOdd function takes a number as argument and returns a true/false based on the parity of the number passed to it.
Note:
- All values passed to the list should be numbers.
- The function is allowed to be saved with decimals but is discouraged from use as parity cannot be determined for decimals.
Return Type
- BOOLEAN
Syntax
<variable> = <number>.isOdd();
(OR)
<variable> = isOdd(<number>);
where,
Parameter | Data type | Description |
<variable> | BOOLEAN | Variable which contains the result of the odd parity check (true/false) |
<number> | NUMBER | The number value on which the odd parity check is performed. |
Examples
1) number=1234; result = number.isOdd(); info result; // Returns 'false'
2) number=111; result = isOdd(number); info result; // Returns 'true'