Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can most calculations be done with integers?

integers
0
Posted

Can most calculations be done with integers?

0

That depends on the type of calculations you plan to do. If it’s just a matter of dealing with a few fractional values, you can scale integer values and store them as fixed-point numbers. As calculations become more complex, or the fractional values are not easily represented by scaled integers (e.g. 1/3), techniques to avoid the use of floating point numbers often become quite elaborate. This can add a layer of complexity on top of the original equations being calculated. Many integer techniques introduce approximation errors resulting in less accurate results. Although some more advanced calculations such as logarithmic and trigonometric calculations can be done with integers using table lookups, the resolution of these calculations is limited by table size. Floating point calculations support a much larger range of numbers and a more complete range of calculations.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123