diff --git a/calculator/calculator.app.js b/calculator/calculator.app.js index acef778..df5f087 100644 --- a/calculator/calculator.app.js +++ b/calculator/calculator.app.js @@ -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;