is_odd

Downloadis_odd(value)   Returns true if the given value is odd.
/*
**  Usage:
**      is_odd(value)
**
**  Arguments:
**      value       a real value
**
**  Returns:
**      TRUE if the given value is odd,
**      FALSE otherwise
**
**  GMLscripts.com
*/

{
    return (argument0 & 1);
}

Click if you've used this script[Please Login]
Projects: 0

 Contributors: Leif902, Schreib, SerMSYS

 History:
Apr 14, 2007 - Leif902 submits original script.
Nov 11, 2007 - SerMSYS fixes a bug regarding the handling of negative numbers.
Feb 2, 2008 - Schreib submits faster script that handles negative numbers and accumulated FP errors.


comments powered by Disqus