0.2.0 • Published 7 years ago

archi v0.2.0

Weekly downloads
291
License
MIT
Repository
github
Last release
7 years ago

+archi Greenkeeper badge

Easy math with decimals for Javascript

Archimedes

Install

Using npm

npm install archi

Using bower

bower install archi

Native simple Javascript sum

0.1 + 0.2; // 0.30000000000000004;
0.3 - 0.1; // 0.19999999999999998;

Solving the issue with archi

var archi = require('archi');
var num = +archi
  .calc(0.1)
  .plus(0.2)
  .plus(0.1)
  .minus(0.1); // 0.3
num === 0.3; // true

But, why the + ahead?

Do this to do a fast conversion from the ArchiNumber instance to the native Number type.

Methods

  • .plus(num): current num + other num
  • .minus(num): current num - other num
  • .mod(num): current num % other num

License

MIT

0.2.0

7 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago