Exp10 function in spin
Does anyone have the EXp10 function coded in spin?
I have no cogs left so I can't use the FloatMath functions.
Paul
I have no cogs left so I can't use the FloatMath functions.
Paul
Comments
ten_exp long 10.0 & %0111111110000000000000000000000
ten_mant long 10.0 & %0000000001111111111111111111111
pub exp10( exp )
return (ten_exp+%0111111110000000000000000000000 & (exp<<22)) & %0111111110000000000000000000000 + ten_mant
quick and dirty because it does not check for overflow. So, as long as you don't deal with to big exponents.
*Note: this is theory ... let's see if it works in practice ;o) *