floating point multiplication BUG in C (cc compiler)

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Tue Oct 23 12:15:42 AEST 1990


In article <4032 at goanna.cs.rmit.oz.au> I wrote:
> The problem here is that a number like 0.64 *CANNOT* *POSSIBLY* be
> represented exactly in (finite-precision) floating-point.  At all.
> In *any* programming language. [...]

In article <RICHARD.90Oct22112830 at lambda.iesd.auc.dk>,
richard at iesd.auc.dk (Richard Flamsholt S0rensen) replied:
>   At least when using *binary* logic as your hardware  ;-)

I think he may have meant binary floating-point, and at that he
may have meant "radix-2 floating-point", or in fact "floating-
point with radix not a power of 10".

I had some mail by people who hadn't paid any attention to the
context.  The context was that the original poster was upset because
his program hadn't worked on six compiler/hardware combinations.
In that context, _only_ the floating-point systems actually available
to that poster are of relevance:  a radix-10 floating-point system
with 99 digits in the significand, whatever its merits, is of no
interest because not available to that poster.

I also note that 2 is distinctly better than other bases for floating-
point arithmetic.  I'm not just referring to the hidden bit (it's hard
to "hide" more than one bit...), I'm referring to the law
	X (<) Y --> X (<=) {X (+) Y}(/)2 (<=) Y
which bisection relies on.

-- 
Fear most of all to be in error.	-- Kierkegaard, quoting Socrates.



More information about the Comp.lang.c mailing list