js-float-calculation

0.1.6 • Public • Published

js-float-calculation

Build Status

Js precision floating point calculation

Useage

1. install

npm i js-float-calculation -S

2.

var jspfpc = require("js-float-calculation");
 
var f1 = 1.01;
var f2 = 2.02;

var f3 = f1.add(f2),
    f4 = f2.sub(f1),
    f5 = f1.mul(f2),
    f6 = f2.div(f1);

console.log("f3="+f3);
console.log("f4="+f4);
console.log("f5="+f5);
console.log("f6="+f6);
 
//"f3=3.03"
//"f4=1.01"
//"f5=2.0402"
//"f6=2"
 
 
 

Package Sidebar

Install

npm i js-float-calculation

Weekly Downloads

14

Version

0.1.6

License

MIT

Last publish

Collaborators

  • ronchi