Hi Joe,
After multiplying 200 * 30 you get 6000, then you multiply times 100, and you end up with 600,000.
When you convert that to an integer (9:27C0h), you only get the lower 16-bit result (27C0h) which is 10,176 decimal. Here you can see why the modulas of //100 ends up as 76.
Try this...aint should now have the 2 decimal places you were looking for.Code:bexp = aexp ' Store the FP value of aarg to the barg variables bargb0 = aargb0 bargb1 = aargb1 Gosub ftoia ' Convert aarg to integer Swap aexp,bexp ' Swap A and B values Swap aargb0,bargb0 Swap aargb1,bargb1 Gosub fpsub ' Subtract the integer portion from the full number bint = 100 ' for 2 decimal places Gosub itofb Gosub fpmul Gosub ftoia
This is the same technique used in the fpdisplay routine in the 4FUNCTN.BAS example.
<br>




Bookmarks