Re: float decimal



On Mon, 11 Dec 2006 21:06:46 -0800, glen herrmannsfeldt wrote:

Personally, if it means fewer posts of "why doesn't 0.1*10.0 equal 1"
then to me it is worth doing. As a fraction of the available
transistors on processors these days, I don't think you will notice it.
It isn't so obvious how much different the speed will be.

A bit of wailing and gnashing of teeth is good for learners. Builds
character. We should not mind it. On the other hand, you could
reasonably point them at any of a fairly large number of languages where
0.1 * 10.0 really is 1.0, if it bothers them (eg. lisp, scheme, rexx,
COBOL, PL/1, even Java, now.) This is clearly a
software/language problem, it should be dealt-with (at least initially) in
that domain, and perhaps accelerated in hardware as that proves necessary
or useful. To Mike's credit, that is what he's suggesting, as far as I
can tell. I just don't see how decimal floats and binary floats can exist
at the same time, retro-fitted into a language like C. Sure you could
duplicate all of the numerical libraries, but what are the promotion rules
when an old library returns a binary float that you want to use in your
code that now uses decimal floats? Is the immediate constant 2.0 still a
binary double? Is there a suffix to give you decimal doubles? If you
think that explaining that 0.1 * 10.0 isn't 1.0, is a chore, imagine how
much fun it will be to explain that (0.2 != 0.20)!

Transistors always matter: they burn power, and if you don't need them,
the space can be used for something else that will make things go faster,
like more cache or another processor.

--
Andrew
.