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