Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!cornell!rochester!ur-tut!sunybcs!boulder!hao!ames!amdcad!sun!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Power operator? Summary: ambiguity Message-ID: <516@goedel.quintus.UUCP> Date: 9 Jan 88 03:47:31 GMT References: <11169@brl-adm.ARPA> <10026@ut-sally.UUCP> Organization: Quintus Computer Systems, Mountain View, CA Lines: 15 There are two power operators: ** double -> double /* pow() */ and ** int -> double /* rtp() -- MISSING */ A quick check though a couple of books of statistical algorithms in Fortran showed me that ** k for k an integer known at compile time appeared roughly once each in fewer than 10% of the functions. The equivalent of pow() was even rarer. Having to write rtp(X, 3) instead of X**3 doesn't seem like such a big deal to me. It's not that common. What irks me is having to write my own rtp(). I know how to do it, but it's not as fast as the vendor could provide, and the vendor-provided one might even do IEEE-854-sensible things. Just to make it clear that pow() is not what is wanted: rtp(-2.0, 3) is -8.0 pow(-2.0, 3.0) involves taking the logarithm of -2.0 ...