Determines if a value is even.

Syntax

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

Returns

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

Remarks

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

While the EVEN 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

// 2 is even 
Result = SRP_Math("EVEN", "2.0") 
!! Result = 1 !! 
// 3 is not even 
Result = SRP_Math("EVEN", "3.0") 
!! Result = 0 !! 
// 0 is even 
Result = SRP_Math("EVEN", 0) 
!! Result = 1 !!

 

 

  • No labels