even, odd, whole
whole returns true if the number is a whole number
even returns true if the number is a whole number and even
odd returns true if the number is a whole number and odd
Indirect parameter passing is disabled
1
No. | Type | Description |
---|---|---|
1 input |
numeral | Value Value to check. |
Type | Description |
---|---|
boolean | Result true if criteria is met. |
Value provided is not a numeral
for all parameters( { 1, 1.5, 2, 3, -1, -1.5 }, p[] )
{
print(p[],": is ");
if (even (p[])) print ("even, ");
if (odd (p[])) print ("odd, ");
if (whole(p[])) print ("whole, ");
echo;
}
1: is odd, whole,
1.5: is
2: is even, whole,
3: is odd, whole,
-1: is odd, whole,
-1.5: is