#33136 - sgeos - Fri Dec 31, 2004 3:02 am
Does anybody know of a way to raise a fixed point number to a fractional exponent (without resorting to floating point)? If anyone is feeling crazy, I'm looking for a function with a prototype that looks something like this:
p_base is the base in fixed point format.
p_power is the power to raise p_base to. May have a fractional component.
p_frac is the number of bits used for the fractional component of the base.
The fractional component of the power is defined by a macro FIXED_POWER_FRAC.
-Brendan
Code: |
FIXED exp_fixed(FIXED p_base, FIXED p_power, FIXED p_frac); |
p_base is the base in fixed point format.
p_power is the power to raise p_base to. May have a fractional component.
p_frac is the number of bits used for the fractional component of the base.
The fractional component of the power is defined by a macro FIXED_POWER_FRAC.
-Brendan