Numerical C - (nf)

bobl at zeus.UUCP bobl at zeus.UUCP
Sat Apr 28 00:53:41 AEST 1984


From: uokvax!emjej:

	"... if you do know what you're doing, promoting float
	to double for all arithmetic operations and function calls
	is a waste of time."

This is true, but I would add that if you REALLY know what you're doing,
floating point in general is a waste of time.  As far as I'm concerned,
the most serious deficiency in C for numerical purposes is lack of "very
long" (i.e., 64 bit) intermediate results in integer computation.  I believe
the IEEE floating point standard guarantees a wide intermediate result
(80 bits?).  (I hear DEC isn't too pleased with that.)  There should be a
similar standard for intermediate integer results.

I am *not* suggesting a "long long" type.  This would require no modification
of C syntax.  The only programs that would be affected would be those that
relied upon generating overflow within expressions during multiplication.

Yes, I know about the "mp" multiple precision package, but if I have to call
a function to multiply two long ints, I've lost to floating point.

	- Bob Lewis
	  ...!tektronix!teklds!bobl



More information about the Comp.lang.c mailing list