pimath 0.0.29 → 0.0.30
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/dev/index.html +9 -4
- package/dev/pi.js +1 -1
- package/dev/pi.js.map +1 -1
- package/dist/pi.js +1 -1
- package/dist/pi.js.map +1 -1
- package/esm/maths/numexp.js +1 -1
- package/esm/maths/numexp.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/numexp.ts +1 -1
- package/tests/numexp.test.ts +14 -1
package/dev/index.html
CHANGED
|
@@ -37,10 +37,15 @@
|
|
|
37
37
|
|
|
38
38
|
<script>
|
|
39
39
|
// let ne = new Pi.NumExp('5/x*sin(x*x)')
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
console.log(
|
|
43
|
-
|
|
40
|
+
const expr2 = new Pi.NumExp('-3*x^2-5')
|
|
41
|
+
|
|
42
|
+
console.log(expr2.evaluate({x: -2}))
|
|
43
|
+
//
|
|
44
|
+
//
|
|
45
|
+
// let ne = new Pi.NumExp('5/x*sqrt(x^2)')
|
|
46
|
+
//
|
|
47
|
+
// console.log(ne.rpn)
|
|
48
|
+
// console.log(ne.evaluate({x: 0}))
|
|
44
49
|
|
|
45
50
|
function dev () {
|
|
46
51
|
let output = []
|
package/dev/pi.js
CHANGED
|
@@ -4334,7 +4334,7 @@ class NumExp {
|
|
|
4334
4334
|
this._addToStack(stack, a + b);
|
|
4335
4335
|
}
|
|
4336
4336
|
else if (element.token === '-') {
|
|
4337
|
-
const b = +stack.pop(), a = +stack.pop();
|
|
4337
|
+
const b = +stack.pop(), a = +stack.pop() || 0;
|
|
4338
4338
|
this._addToStack(stack, a - b);
|
|
4339
4339
|
}
|
|
4340
4340
|
else if (element.token === '^') {
|