Summary: | "atan2" function doesn't work as expected | ||
---|---|---|---|
Product: | [Applications] LabPlot2 | Reporter: | Orestes Mas <orestes> |
Component: | frontend | Assignee: | Stefan Gerlach <stefan.gerlach> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | stefan.gerlach |
Priority: | NOR | ||
Version First Reported In: | 2.8.1 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/education/labplot/commit/443fbde0057f2d34df13b154c260505180b39fed | Version Fixed In: | 2.8.2 |
Sentry Crash Report: | |||
Attachments: | Video showing the bug |
Description
Orestes Mas
2020-11-14 19:30:42 UTC
I can not reproduce the problem. Compiling 2.8.1 on Debian 10 stable and using 180*atan2(1,1)/pi gives me 45, as expected. Can you try again and make a screenshot to see a possible problem? Created attachment 133417 [details]
Video showing the bug
(In reply to Stefan Gerlach from comment #1) > I can not reproduce the problem. Compiling 2.8.1 on Debian 10 stable and > using > 180*atan2(1,1)/pi gives me 45, as expected. > Can you try again and make a screenshot to see a possible problem? Ok, I think you and me are both right. It seems a locale problem: my default system locale is catalan, which has the comma as a decimal separator by default. If I start Labplot with an english locale (like yours, perhaps?), the atan2 function works as expected. Please see the attached video, where the problem is shown and also shows other related issues: if either argument of the atan2 function is a floating point number, the only accepted decimal separator is a comma, which is indistinguishable from the separator between the two «atan2» arguments. This confuses the parser and leads to funny results. Perhaps other character (like the semicolon, for instance) should be used as functions' argument separator when the system locale uses the comma as a decimal separator. I've seen that in other languages... Git commit 443fbde0057f2d34df13b154c260505180b39fed by Stefan Gerlach. Committed on 21/11/2020 at 17:51. Pushed by sgerlach into branch 'master'. Support semicolon as function argument separator in parser to improve support for locale with comma decimal separator FIXED-IN: 2.8.2 M +3 -0 ChangeLog M +3 -0 src/backend/gsl/parser.y https://invent.kde.org/education/labplot/commit/443fbde0057f2d34df13b154c260505180b39fed The parser now supports a semicolon as function argument separator for locale that have a comma already as decimal separator. A comma is still supported for these locale since some expressions (that may be used before) work with it. |