Monday 15 December 2014

Words of Wisdom

"Having one less character to type is NOT a good reason to prefer float over double..."

The extra precision can surprise you by fixing a lot of weird buggy stuff that you hadn't managed to trace back to floating point precision and, unless you're targeting some really specific old hardware or trying to simulate the universe or something, doubles don't cost you anything so might as well use em!

That's the problem with taking examples from badly written books - when your focus is on learning a bit of path-finding or something and the fact that the author riddled his code with floats just doesn't register!

Out of interest, switching to double fixed a few bugs like the rounding of vector angles to their nearest 45 degrees.

No comments:

Post a Comment