Determines if a value is odd.

Syntax

Result = SRP_Math("ODD", Value, "", DecimalPlaces, ScientificNotation)

Returns

1 if Value is odd, or 0 if it is even.

Remarks

The ODD operation determines whether Value is odd or even. If Value is odd, then 1 is returned. If Value is even, than 0 is returned.

While the ODD operation produces no errors, the result of passing a non-integer value are considered undefined. Technically, the last digit is used to determine even or odd, so passing a decimal number will determine the even/odd state of the last decimal number. In mathematics, however, even and odd are usually applied to a whole number.

Example

// 3 is odd 
Result = SRP_Math("ODD", "3.0") 
!! Result = 1 !! 
// 4 is not odd 
Result = SRP_Math("ODD", "4.0") 
!! Result = 0 !! 
// 0 is not odd 
Result = SRP_Math("ODD", 0) 
!! Result = 0 !!
  • No labels