Last Updated: February 25, 2016
·
895
· hidakatsuya

Introduction of SAO.js

SAO.js provides (maybe) strict arithmetic operations for JavaScript.

For example, calculate the following formula in JavaScript.

20.2 - 20 // => 0.1999999999999993

But using SAO.js:

var result = sao.sub(20.2, 20);
sao.finalize(result); // => 0.2

https://github.com/matsukei/sao

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#javascript
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside