pimath 0.0.77 → 0.0.80
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 +65 -2
- 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.d.ts +2 -0
- package/esm/maths/algebra/polynom.js +49 -0
- package/esm/maths/algebra/polynom.js.map +1 -1
- package/esm/maths/coefficients/fraction.js +3 -1
- package/esm/maths/coefficients/fraction.js.map +1 -1
- package/esm/maths/numeric.d.ts +1 -0
- package/esm/maths/numeric.js +12 -0
- package/esm/maths/numeric.js.map +1 -1
- package/esm/maths/randomization/random.d.ts +1 -1
- package/esm/maths/randomization/random.js +1 -1
- package/esm/maths/randomization/random.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/algebra/polynom.ts +56 -0
- package/src/maths/coefficients/fraction.ts +6 -2
- package/src/maths/numeric.ts +12 -0
- package/src/maths/randomization/random.ts +2 -2
- package/tests/algebra/polynom.test.ts +2 -0
- package/tests/coefficients/fraction.test.ts +11 -3
|
@@ -35,7 +35,17 @@ describe('Fraction tests', () => { // the tests container
|
|
|
35
35
|
expect(Q.isReduced()).to.be.false
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
+
it('Should parse a number with lots of decimals', ()=>{
|
|
39
|
+
let A = 3.45,
|
|
40
|
+
B = 3.333333333333322,
|
|
41
|
+
C = 5.314171717171717
|
|
38
42
|
|
|
43
|
+
let FA = new Fraction(A),
|
|
44
|
+
FB = new Fraction(B),
|
|
45
|
+
FC = new Fraction(C)
|
|
46
|
+
|
|
47
|
+
console.log(FA.tex, FB.tex, FC.tex)
|
|
48
|
+
})
|
|
39
49
|
})
|
|
40
50
|
|
|
41
51
|
describe("Fraction static functions", ()=>{
|
|
@@ -76,7 +86,7 @@ describe("Fraction static functions", ()=>{
|
|
|
76
86
|
expect(Fraction.average(...list).tex).to.be.equal('\\frac{ 19 }{ 10 }')
|
|
77
87
|
})
|
|
78
88
|
|
|
79
|
-
it('should multiply and
|
|
89
|
+
it('should multiply and not reduce', function () {
|
|
80
90
|
let list = [
|
|
81
91
|
new Fraction('1/2'),
|
|
82
92
|
new Fraction('4/3'),
|
|
@@ -100,7 +110,5 @@ describe("Evaluate fraction", () => {
|
|
|
100
110
|
let G = new Fraction('1/7')
|
|
101
111
|
expect(G.isApproximative()).to.be.false
|
|
102
112
|
expect(G.isExact()).to.be.true
|
|
103
|
-
|
|
104
|
-
console.log(G.tex, G.value)
|
|
105
113
|
});
|
|
106
114
|
})
|