hwg-techniques archives | Mar 2000 | new search | results | previous | next |
Re: JavaScript test for even or odd numberby Christopher Higgs <c.higgs(at)landfood.unimelb.edu.au> |
|
G'Day Colin, At 21:46 12/03/00 +0000, you wrote: >I'd be interested to hear from anyone who can offer alternative solutions. How about: function number_check(value) { if ((value/2)==(int(value/2)) { // even }else{ // odd } } Chris Higgs <c.higgs(at)landfood.unimelb.edu.au> Institute of Land and Food Resources University of Melbourne http://www.landfood.unimelb.edu.au
HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA