pimath 0.0.73 → 0.0.74
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 +13 -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/expressions/numexp.js +10 -0
- package/esm/maths/expressions/numexp.js.map +1 -1
- package/esm/maths/shutingyard.js +3 -0
- package/esm/maths/shutingyard.js.map +1 -1
- package/package.json +1 -1
- package/src/maths/expressions/numexp.ts +7 -0
- package/src/maths/shutingyard.ts +3 -0
package/dist/pi.js
CHANGED
|
@@ -4744,6 +4744,16 @@ class NumExp {
|
|
|
4744
4744
|
else if (element.token === 'sqrt') {
|
|
4745
4745
|
this._addToStack(stack, Math.sqrt(a));
|
|
4746
4746
|
}
|
|
4747
|
+
else if (element.token === 'nthrt') {
|
|
4748
|
+
// TODO: support nthrt in num. exp.
|
|
4749
|
+
// this._addToStack(stack, Math.pow(a, 1/b))
|
|
4750
|
+
}
|
|
4751
|
+
else if (element.token === 'ln') {
|
|
4752
|
+
this._addToStack(stack, Math.log(a));
|
|
4753
|
+
}
|
|
4754
|
+
else if (element.token === 'log') {
|
|
4755
|
+
this._addToStack(stack, Math.log10(a));
|
|
4756
|
+
}
|
|
4747
4757
|
}
|
|
4748
4758
|
}
|
|
4749
4759
|
if (stack.length === 1) {
|
|
@@ -6937,6 +6947,9 @@ class Shutingyard {
|
|
|
6937
6947
|
'cos': { precedence: 4, associative: 'right', type: ShutingyardType.FUNCTION },
|
|
6938
6948
|
'tan': { precedence: 4, associative: 'right', type: ShutingyardType.FUNCTION },
|
|
6939
6949
|
'sqrt': { precedence: 4, associative: 'right', type: ShutingyardType.FUNCTION },
|
|
6950
|
+
'nthrt': { precedence: 4, associative: 'right', type: ShutingyardType.FUNCTION },
|
|
6951
|
+
'ln': { precedence: 4, associative: 'right', type: ShutingyardType.FUNCTION },
|
|
6952
|
+
'log': { precedence: 4, associative: 'right', type: ShutingyardType.FUNCTION },
|
|
6940
6953
|
};
|
|
6941
6954
|
this._uniformize = false;
|
|
6942
6955
|
}
|