mage has log as ln and then has log10. (#15176)

This commit is contained in:
Clint Rutkas
2021-12-28 04:59:31 -08:00
committed by GitHub
parent 939e8db692
commit f6daf0b1f6
2 changed files with 13 additions and 3 deletions

View File

@@ -34,6 +34,12 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
return default;
}
// mages has quirky log representation
// mage has log == ln vs log10
input = input.
Replace("log(", "log10(", true, CultureInfo.CurrentCulture).
Replace("ln(", "log(", true, CultureInfo.CurrentCulture);
var result = _magesEngine.Interpret(input);
// This could happen for some incorrect queries, like pi(2)