feat: Add 1/x inversion function to operators menu
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -56,6 +56,7 @@ if (process.env.HWVERSION!=1) {
|
||||
operators['='].grid = [1, 3];
|
||||
operators.r = {grid: [0, 2], val: 'sqrt'};
|
||||
operators.s = {grid: [1, 2], val: 'x^2'};
|
||||
operators.i = {grid: [0, 3], val: '1/x'};
|
||||
}
|
||||
|
||||
var specialsGrid = [2, 2];
|
||||
@@ -341,6 +342,16 @@ function buttonPress(val) {
|
||||
}
|
||||
hasPressedNumber = false;
|
||||
break;
|
||||
case 'i':
|
||||
if (results != null) {
|
||||
results = divide(1, results);
|
||||
displayOutput(results);
|
||||
} else if (currNumber != null) {
|
||||
currNumber = divide(1, currNumber);
|
||||
displayOutput(currNumber);
|
||||
}
|
||||
hasPressedNumber = false;
|
||||
break;
|
||||
case 'N':
|
||||
if (results != null) {
|
||||
displayOutput(results *= -1);
|
||||
|
||||
Reference in New Issue
Block a user