floating point multiplication BUG in C (cc compiler)

John F Carr jfc at athena.mit.edu
Mon Oct 22 18:51:23 AEST 1990


In article <1990Oct20.231726.3249 at zoo.toronto.edu>
	henry at zoo.toronto.edu (Henry Spencer) writes:
>In general, you should use `double' for all floating-point arithmetic
>you care about, unless speed or storage is critical and you have done
>a careful analysis of the tradeoffs involved.

On some newer machines, double is faster.  2 examples: the 68881 (used
with the 680x0 and the IBM RT), and the IBM RS 6000.  This is because
the hardware does only high precision calculations, and must take extra
cycles to round to single precision if that is what you ask for by using
type float instead of double.

--
    John Carr (jfc at athena.mit.edu)



More information about the Comp.lang.c mailing list