Floating Point Numbers

Floating Point Numbers

While working on a JavaScript calculator I became stuck in what should be simple mathematics. The use of decimal points resulting in addition and subtraction caused erros in the calculations. The cause is in the way machine language calculates decimal points.

Oracle offers some great insight into the cause and resolution: What Every Computer Scientist Should Know About Floating-Point Numbers

The JavaScript Budget Calculator is a work in progress, to view how a machine interprets decimals check out the demo and then enter decimal points into the budget portion of the calculator: http://mikestratton.net/javascript/calculator/javascript-budget-calculator.html

More information on this subject to follow shortly…

 

0
  Related Posts