feat: add pow10 and exp arithmetic operations

This commit is contained in:
2026-05-16 23:15:22 +02:00
parent 5f2d18df99
commit 6a37c7c1e8
2 changed files with 14 additions and 16 deletions
+1 -15
View File
@@ -237,22 +237,8 @@ function execute(name) {
if (calc.isEditing) {
calc.inputValue = calc.inputValue.startsWith('-') ? calc.inputValue.slice(1) : `-${calc.inputValue}`;
} else {
calc.push(calc.pop() * -1);
calc.command('neg');
}
} else if (name === 'pow10') {
pushEditingValueIfNeeded();
const exponent = calc.stack[0];
calc.remove(0);
calc.push(10);
calc.push(exponent);
calc.command('pow');
} else if (name === 'exp') {
pushEditingValueIfNeeded();
const exponent = calc.stack[0];
calc.remove(0);
calc.push(Math.E);
calc.push(exponent);
calc.command('pow');
} else {
pushEditingValueIfNeeded();
calc.command(name);