On 15 Nov 2009, at 01:19, Marnen Laibow-Koser wrote:
> Eleanor McHugh wrote:
>> In a hardcore physics simulation with many forces then no I wouldn't,
>> but in a simple game then yes I'd probably go with floating-point :)
>
> Why?  I can't see a single reason to use IEEE floats, unless you've  
> done
> benchmarks and are absolutely certain that it's causing a performance
> problem. (Ward Cunningham did just that on a computationally intensive
> Smalltalk application that used fixed-point for all math -- and found
> that he couldn't even measure a difference in performance.)
>
> IEEE floats have no advantages that I can see and huge  
> disadvantages.  I
> just don't see them as being even slightly appropriate or useful for
> math.

Because often expressing non-integral values as floating-point in code  
better represents intent than using fixed-point math, and unless the  
latter will have a performance or accuracy advantage for a given  
problem I consider semantic simplicity to be my primary design  
criterion.

That said I agree that floating-point sucks and that many programmers  
use it in a carefree manner that suggests they're unaware of the  
limitations it imposes.


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
----
raise ArgumentError unless @reality.responds_to? :reason