Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The idea is to multiply all your fractional constants with a scaling factor (powers of 10 to the desired precision), and do all computations on integers. In the last computational step you can scale back the result by a corresponding division (giving you the integral part of the result) and modulus (which gives the decimals, in case you want those too).
You can ensure a proper rounding by adding half of the scaling factor before scaling back the result.
Just make sure your intermediate results don't overflow your chosen data types.
See my answer . You can surely adapt that example to your case.