Bothness

Apparently numbers can be both odd and even…

If IsNumeric(StreetNumberValue) Then
  If 2 Mod CType(StreetNumberValue, Integer) = 0 Then
    OddEven = "E" 'Even
  Else
    OddEven = "O" 'Odd
  End If
Else
  OddEven = "B" 'Both
End If

As seen here:

http://worsethanfailure.com/Articles/Odd-or-Even-or-Both.aspx


Related posts:

  1. The answer in Ruby (so far)
  2. Best javascript function ever
  3. links for 2009-01-12
  4. links for 2009-02-23
  5. links for 2009-04-06

Tags: , , , , , ,

  • http://seanja.com SeanJA

    And it is now properly coloured…

  • http://www.zoeandgavin.com gavinblair

    hey, that’s VB!

  • http://seanja.awesomewebspace.com/wordpress/ SeanJA

    There is that, and the fact that mod is used so that 1 and 2 will be the only 2 even numbers, and all the rest will be odd…