Implementation of pow(3m) function

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Aug 4 07:21:40 AEST 1990


In article <1990Aug2.120706.25713 at bnrgate.bnr.ca> mleech at bcarh342.bnr.ca (Marcus Leech) writes:
>I'm wondering about the efficiency of "standard" implementations of this
>  (and other) math library functions for C.  Does pow(3m) conventionally
>  use a logarithm table, or is it (ugh!) iterative, or some B.O.T?

All common implementations of pow(x,y) basically perform exp(log(x)*y),
but they add some twists designed to avoid unnecessary overflow, or in
the case of 4.3BSD, to implement the IEEE FP funny numbers.  Thus there
is often a considerable amount of additional bookkeeping computation
beyond the log() and exp() evaluations that one would expect.



More information about the Comp.lang.c mailing list