pimath 0.0.71 → 0.0.72
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/.idea/misc.xml +0 -5
- package/dist/pi.js +11 -0
- 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/coefficients/fraction.d.ts +1 -0
- package/esm/maths/coefficients/fraction.js +11 -0
- package/esm/maths/coefficients/fraction.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/coefficients/fraction.ts +13 -0
- package/tests/coefficients/fraction.test.ts +11 -0
package/.idea/misc.xml
CHANGED
package/dist/pi.js
CHANGED
|
@@ -4120,6 +4120,17 @@ class Fraction {
|
|
|
4120
4120
|
this._denominator = this._denominator * Q.denominator;
|
|
4121
4121
|
return this.reduce();
|
|
4122
4122
|
};
|
|
4123
|
+
this.xMultiply = (...values) => {
|
|
4124
|
+
// Parse the value.
|
|
4125
|
+
// If it's a fraction, return a clone of it
|
|
4126
|
+
// If it's an integer, return the fraction F/1
|
|
4127
|
+
for (let value of values) {
|
|
4128
|
+
let F = new Fraction(value);
|
|
4129
|
+
this._numerator = this._numerator * F.numerator;
|
|
4130
|
+
this._denominator = this._denominator * F.denominator;
|
|
4131
|
+
}
|
|
4132
|
+
return this;
|
|
4133
|
+
};
|
|
4123
4134
|
this.divide = (F) => {
|
|
4124
4135
|
let Q = new Fraction(F);
|
|
4125
4136
|
if (Q.numerator === 0) {
|