Post Reply  Post Thread 
Daily WTF
Author Message
01-19-2007, 11:28 AM (This post was last modified: 03-15-2007 05:25 PM by LtSterling.)
Post: #1
Daily WTF
Those of you who are Of The Code, you'll probably get a kick out of this site:

http://thedailywtf.com/Default.aspx

IT also taught me something today that I never knew (or knew, and forgot): float values can't store some values (such as 0.1) exactly since they're infinitely repeating in binary.

It's a good thing I'm not stupid enough to test direct equality in a floating point (because when you're working with floats, the chance of being exactly on any given value is rare, particularly in gaming) unless I'm using it as a boolean for convenience sake, since it can store 1 and 0 pretty well. Not a good programming practice, but it'd be a pain to use a union for what I need it for.




W

[Image: emperorwebrunnr.jpg]
[Image: webrunner42.png]

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
Daily WTF - webrunner - 01-19-2007 11:28 AM
RE: Daily WTF - masamunemaniac - 01-19-2007, 11:50 AM
RE: Daily WTF - Zemyla - 01-19-2007, 12:47 PM
RE: Daily WTF - masamunemaniac - 01-19-2007, 12:54 PM
RE: Daily WTF - Ultros - 01-19-2007, 12:58 PM
RE: Daily WTF - E-mouse - 01-19-2007, 02:58 PM
RE: Daily WTF - TheTubstar - 01-19-2007, 03:08 PM
RE: Daily WTF - E-mouse - 01-19-2007, 03:11 PM
RE: Daily WTF - Flipkat - 01-19-2007, 08:20 PM
RE: Daily WTF - *NightWind* - 01-20-2007, 03:20 AM
RE: Daily WTF - Arsonic - 01-20-2007, 11:45 PM
RE: Daily WTF - E-mouse - 01-21-2007, 03:32 AM
RE: Daily WTF - Ultros - 01-22-2007, 06:53 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this thread |
-->