Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!munnari.oz.au!bruce!trlluna!rhea.trl.oz.au!aduncan From: aduncan@rhea.trl.oz.au (Allan Duncan) Newsgroups: comp.lang.c Subject: Re: Implementation of pow(3m) function Message-ID: <2055@trlluna.trl.oz> Date: 9 Aug 90 22:16:32 GMT References: <17301@haddock.ima.isc.com> Sender: root@trlluna.trl.oz Lines: 16 From article <17301@haddock.ima.isc.com>, by karl@haddock.ima.isc.com (Karl Heuer): > *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.) Ahh! Shades of Fortran! This is one of the reasons that ancient language still keeps alive and well. I find C's handling of mixed mode arithmetic a little less than satisfactory, and the need to write everything as functions obscures the mathematical form of an expression. I might be forced to look at C++ if I am to throw over Fortran. Allan Duncan ACSnet a.duncan@trl.oz (03) 541 6708 ARPA a.duncan%trl.oz.au@uunet.uu.net UUCP {uunet,hplabs,ukc}!munnari!trl.oz.au!a.duncan Telecom Research Labs, PO Box 249, Clayton, Victoria, 3168, Australia.