The answers are correct. Surprised? Here's how it works
480/148 = 3 in integer math.
= 3.24 in fractional math
480 mod 148 = 36 how?
480 - (148*3) = 36
Then you might ask, what is the 0.24 and 36.
When you multiply 0.24 by the divisor 148, you get the fraction that remains 36.
If you want to do fixed place math, multiply the upper number by 100 and you will get a result that has the additional 2 digits and you put the decimal after dividing by 100.
eg : 480 / 148 now becomes (480*100)/148
result will be 324. This is actually 100 times greater because we multiplied by 100. So, while printing the value, you print 324/100, ".", 324 mod 100 to get the proper value of 3.24
You might find more ports out here explaining flxed point math - search
Bookmarks