Implementation of pow(3m) function

Karl Heuer karl at haddock.ima.isc.com
Thu Aug 9 09:42:38 AEST 1990


In article <3511 at goanna.cs.rmit.oz.au> ok at goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
>UNIX implementations of pow _do_ [special-case integer exponents].

*Some* Unix implementations do.  I have observed others in which roundoff
error causes (int)pow(2.0, 3.0) to return 7; this is an excellent reason not
to use pow() when you want integer exponentiation.  (I myself would prefer a
new operator, `*^'.  I wrote an essay on this a couple of years ago.)

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint



More information about the Comp.lang.c mailing list