To return Yes (true) if the number is odd
With this function, you can check whether a number is odd, i.e. not divisible by 2 without remainder. The return value is either Yes (true
) or No (false
). 0 is evaluated as even, and therefore returns No (false
).
odd(number)
boolean
Result: No (false
)
Result: Yes (true
)
Result: No (false
)
Result: Yes (true
)
even
which returns Yes (true
) if the number is even.