Skip to main content
Engineering LibreTexts

15.3: Math

  • Page ID
  • Usually, embedded code is not math intensive. There are some exceptions to this rule, but generally code for a microwave oven doesn’t need something like a cosine function. Many embedded systems do not have or need floating point math. All math operations are performed using integers. Look-up tables may be used to speed processing in some cases. You will sometimes hear of “fixed point” math versus floating point. This is a fairly simple idea. Suppose you need to work with variables to the precision of tenths but you only have integers. Simply treat your variables as having an unseen decimal point after the first digit and think of all values as being in tenths. Thus, the number 17.3 would be stored and manipulated as 173. If the result of some calculation is say, 2546, then you know the real answer is 254.6.