[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Numerical Comparison: "required coercions"

I think that comparing more than 2 operands could simply be 
forbidden since the semantics is unclear and the utility
is doubtful.

I disagree with the statement that "it is misleading to
*add* bits of precision during a computation."  In fact,
unless the language starts by assuming that ALL 
numbers, floating point numbers or rationals are exact, 
you are in trouble.  (Some languages screw this up,
and perhaps this is where the inspiration comes from.)

The best model might be to say that changing representations
(e.g. float to double conversion) is fine, as long
as it doesn't change the value.
But rational to float sometimes changes values
(sometimes it loses the whole ball of wax when the
  number over/underflows). This is not good.
Confusing accuracy with precision is dangerous.
No one knows for sure that 1/3 is more accurate than
0.3.  In fact, they may both be used as poor approximations
to 1/2.  

There is an IEEE "inexact" flag which pertain to operations,
not operands. It helps you do things in lower precision
than you thought you could, and still get the right answer.
More later.,.