| Summary: | log10(n) is not recognized as a calculator function | ||
|---|---|---|---|
| Product: | [Plasma] krunner | Reporter: | gluedrinker |
| Component: | calculator | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | minor | CC: | alexander.lohnau, john.kizer, natalie_clarius, nate |
| Priority: | NOR | ||
| Version First Reported In: | 6.2.4 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
gluedrinker
2024-12-10 22:34:04 UTC
I can reproduce this on Plasma 6.2.4. For what it's worth, KCalc itself does interpret log() as base 10, so it appears to be something specific on the KRunner side? Well, this was bugging me and I wanted to see if there was something that would explain it...and as it turns out, KRunner actually uses Qalculate as its backend for the calculator function (https://userbase.kde.org/Plasma/Krunner#Calculator), Qalculate views log() as ambiguous without a specific base, and it defaults to e as the base. If you type log(10; 10) into KRunner, for example, you should get 1 as expected. So, this is *kind of* intended behavior...however, I do think there's a bug here still, as the intended Qalculate Base-10 Logarithm function - log10() - doesn't seem to be recognized by KRunner, so I switched the title accordingly. I'm saying that's the intended Base-10 log function based on the Qalculate manual (https://qalculate.github.io/manual/qalculate-definitions-functions.html#qalculate-definitions-functions-1-Exponents--Logarithms) and a comment left by a Qalculate contributor on this topic: "In Qalculate log() is primarily intended for logarithms with bases other than 10 or e" (https://github.com/Qalculate/libqalculate/pull/430) Works as expected if you add an equals sign before it: "=log10(5)". This is sometimes needed when invoking Qalculate functions directly, which is a bit of a hidden feature. |