Faster fractional multiply
Bobb Fwed
Posts: 1,119
I want to multiply a 16-bit number by 1.054. Is there a faster way to do it other than float math and not using any additional cogs.
Comments
Use PhiPi's solution. I always forget that SPIN uses signed values. (Plus his is probably slightly faster anyway.)
This multiplies y by 0.054 * 232, returning the high 32 bits, then adds the result to y (i.e. the "1" part).
-Phil
result = (x << 16) * $1_0DD2
Changed it to Thanks!