Do the Math! An Introduction To Machine Calculations
Improvements in languages, compilers, hardware, and even standards continue to simplify the task of performing mathematical calculations in embedded systems. Even with these improvements, though, the calculations do not always perform as expected.
This paper compares the different types of machine calculations—integer, fixed point, and floating point—in terms of versatility, accuracy and speed. It looks at the sources of errors for each type and ways to manage them. It covers type conversions, overflow effects, implementation tricks, custom integer sizes, and machine dependencies. It shows how to implement fixed point math using integers and customize it to your needs. The emphasis is on simplicity and practicality. Examples are given in “C”, although the concepts apply equally well to other programming languages.
Please disable any pop-up blockers for proper viewing of this Whitepaper.