Re: Odd or Even

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Note that this returns true for non-integer values (which are neither
odd nor even).

OTOH, the ATP's ISODD function truncates the number first, so

=ISODD(1.9) ===> FALSE
=ISODD(2.9) ===> TRUE

which seems worse to me.


In article <OcPJAebcFHA.456@xxxxxxxxxxxxxxxxxxxx>,
"Bob Phillips" <phillips@xxxxxxxxxxxxx> wrote:

> Public Function IsOdd(Val) As Boolean
> IsOdd = (Val \ 2) * 2 <> Val
> End Function
.


Quantcast