PDA

View Full Version : fractional code



luisfe
- 26th November 2015, 20:15
Excuse me for it is an elementary item.
I have to divide a pair of two digit integers and handle the result (decimal with fraction) just two digits fractional. Then multiply this last with a percentage.
I know one have to scale and descale, but if somebody have a simmilar simple code for this simple example, I'd be very grateful if you share it just for saving time. (Time is life, so it is not a little thing)

luisfe
- 26th November 2015, 20:54
I can't use div32 because I'm using pbpl

Dave
- 27th November 2015, 13:57
Just multiply the 2 variables by 100 to begin with then do the division. That way you have 2 decimal places in the result.