Re: Adding floating point numbers



I do also. I use it when I'm feeling lazy, such as for computing the correct font height
to allow a string to fit into a fixed-size box. And even then, the roundoff error is an
absolute killer, to the point where I can only use it for a first-approximation and then
have to do successive approximation to find the actual value.
joe

On Sun, 1 Jul 2007 16:41:16 -0700, "Tom Serface" <tom.nospam@xxxxxxxxxxxxx> wrote:

Most of the time my floating point stuff is for financial or percentage type
calculations which can easily be done and retained using integers. I can
certainly see floating point being handy for all kinds of graphical
calculations, I just find it to be much easier to work around them whenever
precision is necessary.

Tom

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:g95g8397hbt15tfbbi5itm6ahl58uo0pf2@xxxxxxxxxx
John von Neumann thought floating point was a serious mistake, because
anyone who had a
clue as to what he was doing could do everything in integer mode keeping
track of the
decimal place (binary decimal place) in their head while writing the code.
Besides,
integer operations were easy to implement on contemporary computers, but
floating point
was going to be slow and expensive. (A Pentium-4 can do a 32-bit * 32-bit
floating
multiply in 1 CPU clock cycle, that is, 350ps on a 2.8 GHz machine). He
also felt it
would make programmers lazy because they would no longer keep track of the
precision.

(He was right: back in the days of the Bush Guard memos, one analyst
claimed that he could
measure the precision of superscript alignment to something like 0.01%,
even though he was
working on data with an inherent 3% error, proving that there are people
out there who
simply don't understand numbers. I ripped his analysis to little tiny
shreds and stomped
on them)

However, von did do a study of what made good floating point, which is why
we had a lot of
36-bit machines (7090, DEC-10, etc.), because with 9 bits of exponent and
27 bits of
mantissa, you had enough precision for any real physical problem.

One day back in 1982 I walked into my manager's office carrying a source
listing and said
"This job is doing bad things to my mind". When he asked why, I pointed
to a declaration
I had just written, which said
float n;
it was the first time I had used floating point numbers in well over a
decade.

I rarely use them, although I have a couple algorithms in which they
simplify coding.
joe
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Announcing Intel Fortran Compilers 9.0
    ... precision up only because it's natural for 64 bit computing. ... so that 64 bit floating point data can be loaded or stored in one bus cycle. ... It is also possible that 64 bit processors are slightly more efficient moving data to and from memory, which can also help 64 bit floating point. ...
    (comp.lang.fortran)
  • Re: Linear Algebra Challenge
    ... Since I'm using floating point, so I'll never be able to calculate one ... floating point math set to 99 digits. ... As close as I'm willing to wait if I use arbitrary precision. ... This mode is fast; when you select arbitry ...
    (comp.sys.hp48)
  • Re: Floating point environment
    ... In all functions like fetestexcept, for instance, it is assumed that there is only one floating point environment ... one for double precision ... the 64 bit format and another for the 80 bit format. ... All versions of SSE use a status/control word separate from the main FPU, however, so they can indeed be considered a separate environment. ...
    (comp.std.c)
  • Re: ML matrices multiplication accuracy
    ... Core Duo Processor T2500), I got all 9 cases exactily the same: ... accept just two floating point inputs and then round the result back down ... to 53 bits precision each time. ... I know that there are such instructions ...
    (comp.soft-sys.matlab)
  • Re: This calculation is just wrong / computer cant count!
    ... This is because of how 64-bit floating point arithmetic works. ... Any finite precision arithmetic, whether it is ... significant digits yourself. ... So we have units of inches, feet, ...
    (microsoft.public.vc.mfc)