being returned. Logarithm and exponential Logarithm in base 2 is relatively straightforward, as the integer part k is already in the floating-point exponent; a preliminary range reduction is accordingly performed, yielding k. The mantissa x (where log2(x) is between -1/2 and 1/2) is then compared to a table and intervals for further reduction into a z with known log2 and an in-range x/z, along with polynomial coefficients used for the interval x/z is in. The result is then log(z) + log(x/z) + k. Logarithm in other bases follow a similar approach, with the differences being (a) a different table is used; (b) k needs to be multiplied by log2(new-base). Exponential in base 2 is similarly the "base case" due to floating-point structure. The procedure is simply a combination of range reduction (usually by lookup) and a polynomial over the remaining mantissa. The natural exponent may be implemented with a separate table for precision, while exp10 can simply be exp(x × log2(10)) when in-range. Finally, the any-base exponent function pow() is built around exp() and log() in the general case. See also Intrinsic function List of numerical libraries References Programming libraries