isOdd

isOdd

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,

ParameterData typeDescription
<variable>BOOLEANVariable which contains the result of the odd parity check (true/false)
<number>NUMBERThe 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'

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com