I am learning about Operating System programming and I need to assume I have few resources.
Then how should I, for example, compute 2 / 3 and truncate that to two decimal places? Are there any math algorithms or bit manipulation tricks I can possibly use?
You can’t round floating point number to base 10 two places or any number of base 10 places, floating point numbers are just approximations. There are lots of base 10 number which just can not be represented exactly as base 2 number with a finite number of decimal places, this is for the exact same reason you can not represent the number 1/3 in base 10 with a finite number of decimal places. You should either treat you float as approximations and then only round as part of your display. Or if you don’t want approximation then do something like use integer to represents 1/100ths and then divide them by 100 to get you value to display.