$isodd
Welcome to our Knowledge Base
Documentation | Blog | Demos | Support
< All Topics
Print
$isodd
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
Tests if a number is odd.
Syntax
$isodd(expression)
Parameters
expression | a number, or an expression that evaluates to a number |
Return Value
If expression evaluates to an odd number, the function returns “1” ($True); if expression evaluates to an even number, the function returns”0″ ($False)
If expression does not evaluate to a number, the software raises an error. The function returns “0” ($False).
Comments
Expression is rounded before testing.
Example
$isodd(vAmount)=$False
Evaluates to $True if vAmount is even.
$isodd(-5)
Evaluates to $True.
$isodd(Salary*1.1)
Evaluates to $False if Salary is 20,000.
$isodd("123.4")
Evaluates to $True.
$isodd("abc")
Evaluates to $False.
See Also
Updated
ByJason Lee
Was this article helpful?
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
5