So many solutions... heh.. here's a simple minded persons approach... did I miss something ?
Code:Public Function iseven(arg As Variant) myiseven = arg / 2 = Int(arg / 2) End Function
1 divided by 4 equals 1/4, which isn't even or odd, since the concepts even and odd apply only to integers
May be, but my point of view in this issue is the same as of ISEVEN() Excel function: cell formula =ISEVEN(-2.5) returns TRUEHmmm... I see that decimal thing coming into play, but I was always under the assumption that fractional numbers were niether Odd nor Even.
Any integer that can be divided exactly by 2.
http://en.wikipedia.org/wiki/Parity_(mathematics)
http://www.cs.uiuc.edu/class/fa07/cs173/notes/proofs.pdf