pimath 0.0.81 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pi.js +3 -4
- package/dist/pi.js.map +1 -1
- package/dist/pi.min.js +1 -1
- package/dist/pi.min.js.map +1 -1
- package/esm/maths/algebra/polynom.js +2 -2
- package/esm/maths/algebra/polynom.js.map +1 -1
- package/esm/maths/numeric.d.ts +1 -1
- package/esm/maths/numeric.js +1 -2
- package/esm/maths/numeric.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/algebra/polynom.ts +2 -2
- package/src/maths/numeric.ts +2 -5
- package/tests/algebra/polynom.test.ts +0 -2
- package/dev/pi.js +0 -7549
- package/dev/pi.js.map +0 -1
package/dist/pi.js
CHANGED
|
@@ -3221,7 +3221,7 @@ class Polynom {
|
|
|
3221
3221
|
display += `(${item.factor.display})${item.degree > 1 ? '^(' + item.degree + ')' : ''}`;
|
|
3222
3222
|
}
|
|
3223
3223
|
}
|
|
3224
|
-
return display
|
|
3224
|
+
return display;
|
|
3225
3225
|
}
|
|
3226
3226
|
get length() {
|
|
3227
3227
|
// TODO: Must reduce the monoms list to remove the zero coefficient.
|
|
@@ -3269,7 +3269,7 @@ class Polynom {
|
|
|
3269
3269
|
_parseString(inputStr, ...values) {
|
|
3270
3270
|
if (values === undefined || values.length === 0) {
|
|
3271
3271
|
inputStr = '' + inputStr;
|
|
3272
|
-
this._rawString = inputStr;
|
|
3272
|
+
this._rawString = inputStr.trim().replaceAll(' ', '');
|
|
3273
3273
|
// Parse the polynom using the shutting yard algorithm
|
|
3274
3274
|
if (inputStr !== '' && !isNaN(Number(inputStr))) {
|
|
3275
3275
|
this.empty();
|
|
@@ -6574,7 +6574,7 @@ class Numeric {
|
|
|
6574
6574
|
}
|
|
6575
6575
|
return triplets;
|
|
6576
6576
|
}
|
|
6577
|
-
static numberCorrection(value) {
|
|
6577
|
+
static numberCorrection(value, epsilon = 0.00000000000005, number_of_digits = 6) {
|
|
6578
6578
|
// Must modify the number if it's like:
|
|
6579
6579
|
// a: 3.0000000000000003
|
|
6580
6580
|
// b: 3.9999999999999994
|
|
@@ -6589,7 +6589,6 @@ class Numeric {
|
|
|
6589
6589
|
decimal = decimal.split('.')[1];
|
|
6590
6590
|
return decimal.substring(0, decimal.length - 2);
|
|
6591
6591
|
}
|
|
6592
|
-
const epsilon = 0.00000000000001, number_of_digits = 6;
|
|
6593
6592
|
const decimal = extractDecimalPart(value);
|
|
6594
6593
|
if (decimal === '') {
|
|
6595
6594
|
return value;
|