Why? =A0I can't see a single reason to use IEEE floats, unless you've don= e
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.)
So Ward found that fixed point integers weren't SLOWER then floats,
what a surprise!
IEEE floats have no advantages that I can see and huge disadvantages. =A0= I
just don't see them as being even slightly appropriate or useful for
math.
That's just silly if you ask me.
First of all BigDecimals are still floats, with a decimal base and a
variable length, but floats nonetheless.
They aren't a magic bullet, and despite what you said in a slightly
later post, they are neither semantically clear:
=3D> "1.85000000000000008882"
but also
0.999999999999999999999999999999999999999999999999999999E0
Usually people flock to BigDecimal when they discover something like
the first example. But changing the base to 10 only
changes WHICH rational numbers can't be represented, it doesn't
eliminate the problem entirely.
or numerically precise.
Yes perhaps they are more precise but at an increasing cost of
performance as the 'need' to carry around extra digits increases.
I.E.E.E Floating point is just the culmination of the floating point
data types which got us to the moon in the 1960s. They are quite
usable as long as the programmer understands their properties and
limitations, BigDecimal has these limitations as well, just different
parameters on those limitations.
Engineers back then were very used to working with primitive computers
which used floating point numbers of extremely limited precision,
maybe 2 or 3 digits in the fractional part, those computers were
called slide rules.
When I was a young lad, it used to be that young programmers took a
semester long course on numerical analysis, which started with, and
continuously came back to dealing with the properties of floating
point numbers.
I guess that doesn't happen much anymore.
--=20
Rick DeNatale
Blog:
http://talklikeaduck.denhaven2.com/
Twitter:
http://twitter.com/RickDeNatale
WWR:
http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn:
http://www.linkedin.com/in/rickdenatale