adamwdraper/Numeral-js — pull request #117 by ragulka (2013-11-22 14:58:03+00:00)
Title: Add float precision math support

As we all know, `0.1+0.2` does not produce `0.3` in Javascript, as one would expect. Instead, it results in `0.30000000000000004`. The issue is explained in greater detail in this [SO question](http://stackoverflow.com/questions/588004/is-javascripts-floating-point-math-broken).

Numeral has add, subtract, multiply, divide and difference methods, which currently naively do math operations with floats and give the same kind of non-correct results.

This PR fixes the issue with math operations with floats. The implementation is borrowed from [sinful.js](http://guipn.github.io/sinful.js/), with some modifications to make it a bit lighter.

So the below now works:
```javascript
numeral(0.2).add(0.1).value(); // 0.3
numeral(0.3).subtract(0.1).value(); // 0.2
numeral(0.1).multiply(0.2).value(); // 0.0.2
numeral(5.3).divide(0.1).value(); // 53
```