fix: Fix Math.log10 not found error using Math.log equivalent
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -217,7 +217,7 @@ function toExponential(num, precision) {
|
||||
sign = "-";
|
||||
num = -num;
|
||||
}
|
||||
var exp = Math.floor(Math.log10(num));
|
||||
var exp = Math.floor(Math.log(num) / Math.LN10);
|
||||
var mantissa = num / Math.pow(10, exp);
|
||||
|
||||
var mantissaFixed = mantissa.toFixed(precision);
|
||||
@@ -452,10 +452,10 @@ function buttonPress(val) {
|
||||
break;
|
||||
case 'log':
|
||||
if (results != null) {
|
||||
results = Math.log10(results);
|
||||
results = Math.log(results) / Math.LN10;
|
||||
displayOutput(results);
|
||||
} else if (currNumber != null) {
|
||||
currNumber = Math.log10(currNumber);
|
||||
currNumber = Math.log(currNumber) / Math.LN10;
|
||||
displayOutput(currNumber);
|
||||
}
|
||||
hasPressedNumber = false;
|
||||
|
||||
Reference in New Issue
Block a user