AnsweredAssumed Answered

Fixed point vs emulated integer math

Question asked by hdp on Mar 16, 2011
Latest reply on Mar 21, 2011 by stevek
Sorry if this is a bit of a numpty question!
With reference to BF561, suppose I have:
a = 0.95 and b = 123
and I do, c = a*b = 116.85
If I am only interested in keeping '116' (so can discard the fraction) what is the best way of doing the math?
Is it still more efficient (due to nature of BF561) to make a & c as fract16 or could I do:
a = 95, b = 123. So c = a*b/100
Or just typecast? Or is there another way altogether?

Outcomes