fraction.js
Advanced tools
Comparing version 3.3.0 to 3.3.1
{ | ||
"name": "fraction.js", | ||
"main": "fraction.js", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"homepage": "http://www.xarg.org/2014/03/precise-calculations-in-javascript/", | ||
@@ -6,0 +6,0 @@ "description": "A rational number library", |
/** | ||
* @license Fraction.js v3.3.0 09/09/2015 | ||
* @license Fraction.js v3.3.1 09/09/2015 | ||
* http://www.xarg.org/2014/03/precise-calculations-in-javascript/ | ||
@@ -726,3 +726,3 @@ * | ||
// rough estimate to fill zeros | ||
var length = 10 + cycLen + cycOff + p.length; // 10 = decimal places when no repitation | ||
var length = 15 + cycLen + cycOff + p.length; // 15 = decimal places when no repitation | ||
@@ -729,0 +729,0 @@ for (var i = 0; i < length; i++, t*= 10) { |
{ | ||
"name": "fraction.js", | ||
"title": "fraction.js", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"homepage": "http://www.xarg.org/2014/03/precise-calculations-in-javascript/", | ||
@@ -11,2 +11,3 @@ "bugs": "https://github.com/infusion/Fraction.js/issues", | ||
"main": "fraction", | ||
"private": false, | ||
"readmeFilename": "README.md", | ||
@@ -13,0 +14,0 @@ "directories": { |
@@ -199,3 +199,3 @@ # Fraction.js - ℚ in JavaSript | ||
The method is really precise, but too large exact numbers, like 1234567.9991829 will result in a wrong approximation. If you want to keep the number as it is, convert it to a string, as the string parser will not perform any further observations. | ||
The method is really precise, but too large exact numbers, like 1234567.9991829 will result in a wrong approximation. If you want to keep the number as it is, convert it to a string, as the string parser will not perform any further observations. If you have problems with the approximation, in the file `examples/approx.js` is a different approximation algorithm, which might work better in some more specific use-cases. | ||
@@ -202,0 +202,0 @@ |
var assert = require('assert'); | ||
var Fraction = require('../fraction.min'); | ||
var Fraction = require('../fraction'); | ||
@@ -293,2 +293,8 @@ var tests = [{ | ||
}, { | ||
label: "1 / 195312500", | ||
set: '1', | ||
fn: "div", | ||
param: "195312500", | ||
expect: "0.00000000512" | ||
}, { | ||
label: "10 / 0", | ||
@@ -544,3 +550,3 @@ set: 10, | ||
param: 0, | ||
expect: "3.1415876535" | ||
expect: "3.14158765358987" | ||
}, { | ||
@@ -547,0 +553,0 @@ label: "99+1", |
72661
2175