2

I would like to teach a class on the "magic" behind the calculator, so I would like to generate a list of "algorithms" for how a calculator computes the things we want it to. I will get the ball rolling:

  1. Addition and subtraction is done via binary addition and subtraction.
  2. Logarithms and exponentiation is done via Taylor series.
  3. I'm not too sure about multiplication and division, do calculators do binary multiplication or do they use logarithms?

I hope that teaching students the mathematics behind the calculator would trigger a reaction everytime they use one in the future.

BlackAdder
  • 4,029
  • actually, logarithms and trigonometric functions are probably calculated by lookup tables.. – Nathaniel Bubis Dec 20 '13 at 01:24
  • @BlackAdder: http://math.stackexchange.com/questions/14066/calculator-algorithms, http://www.qc.cuny.edu/Academics/Degrees/DMNS/Faculty%20Documents/Sultan1.pdf, http://www.stewartcalculus.com/data/default/upfiles/LiesCalcAndCompTold.pdf – Amzoti Dec 20 '13 at 01:30
  • One difficulty will be the fact that not all calculators are the same. Of course, for the most part similar algorithms are used, but a CAS may rely less on numerical methods in certain situations, for example – Platonix Dec 20 '13 at 01:33
  • You may find other stackexchange sites - for example, cs.stackexchange.com - more useful for this! – Newb Dec 20 '13 at 01:35
  • Thanks guys! These are great! – BlackAdder Dec 20 '13 at 01:38
  • Exponentials, logs, trig, and etc. have rather sophisticated algorithms. Look through the source code of glibc or the math library of FreeBSD. – Stephen Montgomery-Smith Dec 20 '13 at 01:38
  • Multiplication and division is not done using logs and exponentials. I think it is done the usual way. But there are probably lots of clever tricks they have devised with many short cuts. – Stephen Montgomery-Smith Dec 20 '13 at 01:39
  • For functions beyond the basic four, often calculators use a sparse table/computation combination called the CORDIC algorithm. Padé approximation is also used. I mention using the CORDIC algorithm for logarithms in this answer, but it can be used for exponentials, trigonometric, and other functions. – robjohn Dec 20 '13 at 02:52

0 Answers0