by Rhound50 » Tue Sep 25, 2007 9:55 am
.999999.... != 1 in the computer science world. This is a hard lesson pretty much everyone gets to learn the first time you try to compare (float)1 with int 1. Non-exact values (float, double, decimal) are often times stored not 100% accurate and (float) 1 is often either .9999999999999... or 1.00000000...........01 and trying to do a direct comparison with 1 can lead to banging your head against the desk, throwing things, and cursing.
"Its a pink handbag not backpack damn it." Godlikeroy
"From playing full tilt I wanna smash every garden gnome I see. That travelocity commercial puts me on instant tilt."