Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Implementation of pow(3m) function Keywords: math-library exponentiation C Message-ID: <17301@haddock.ima.isc.com> Date: 8 Aug 90 23:42:38 GMT References: <1990Aug2.120706.25713@bnrgate.bnr.ca> <13474@smoke.BRL.MIL> <46584@brunix.UUCP> <3511@goanna.cs.rmit.oz.au> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 9 In article <3511@goanna.cs.rmit.oz.au> ok@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@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint