Bug 267203 - Multiple argument functions broken (nothing reasonable accepted as argument separator)
Summary: Multiple argument functions broken (nothing reasonable accepted as argument s...
Status: RESOLVED FIXED
Alias: None
Product: kmplot
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Klaus-Dieter M
URL:
Keywords:
: 214527 400068 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-26 21:22 UTC by Szczepan Hołyszewski
Modified: 2018-11-09 21:50 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
remove conversion of the locale to "." (728 bytes, patch)
2016-07-21 12:06 UTC, Mario Bensi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szczepan Hołyszewski 2011-02-26 21:22:26 UTC
Version:           unspecified
OS:                Linux

The functions min() and max(), mod(), and possibly all predefined variadic functions don't accept comma, or anything reasonable (e.g. semicolon) as argument separator.



Reproducible: Always

Steps to Reproduce:
1. Try creating a new Cartesian plot with the following formula:

f(x) = max(x,2*x)

Actual Results:  
The comma is highlighted in red, which means that it is not accepted as argument separator.

Expected Results:  
The comma should be accepted as argument separator.

Apparently locale related: comma is interpreted as decimal point. The following formula is accepted:

f(x) = max(1,2)

but it is interpreted as max(1+2/10).

This is one of several problems related to the fact that kmplot apparently uses an amateur-ish formula parser. I will be filing a separate bug report for that.

OS: Linux (i686) release 2.6.37-ARCH
Compiler: gcc
Comment 1 Christoph Feck 2011-12-05 14:20:42 UTC

*** This bug has been marked as a duplicate of bug 214527 ***
Comment 2 Szczepan Hołyszewski 2012-02-28 15:46:33 UTC
I don't think this should be marked as a duplicate of bug 214527. I reported that one earlier, but then I realized that the problem is more general, and reported this one.
Comment 3 Szczepan Hołyszewski 2012-02-28 15:48:09 UTC
*** Bug 214527 has been marked as a duplicate of this bug. ***
Comment 4 Szczepan Hołyszewski 2012-10-17 05:23:31 UTC
I think the policy should be that you are NOT allowed to resolve a bug by marking it a duplicate of an unconfirmed bug. How can you tell it is a duplicate if you have not spent enough time studying the supposed original bug to even confirm it?
Comment 5 Christoph Feck 2012-10-17 08:50:05 UTC
Szczepan, kmplot currently has no maintainer. It does not make sense to keep duplicates open, as the number of open bugs would grow and raise the barrier for newcomers looking for a project to maintain.
Comment 6 Szczepan Hołyszewski 2012-10-17 09:37:59 UTC
(In reply to comment #5)
> Szczepan, kmplot currently has no maintainer.

Ah, that makes things different :( Thanks for for explaining.
Comment 7 Christoph Feck 2014-09-17 13:26:58 UTC
So, how are we going to resolve this? The issue here is that the ',' char can be used as the decimal separator in many locales. I see three possibilities:

A) force '.' as the decimal separator, as is done in KAlgebra (until someone complains about the locale issue there),

B) use ';' as the multi-argument separator when "calling" the function, e.g. you declare "f(x,y)=" but use "f(x*2;12)" for the expression,

C) require a space after ',' for multiple arguments, e.g. use f(x*2, 12).
Comment 8 Mario Bensi 2016-07-21 12:06:49 UTC
Created attachment 100233 [details]
remove conversion of the locale to "."
Comment 9 Christoph Feck 2018-10-21 03:56:07 UTC
*** Bug 400068 has been marked as a duplicate of this bug. ***
Comment 10 Yuri Chornoivan 2018-11-09 21:50:39 UTC
Git commit 817c8700db18c19474095e4e4ffb025040b98491 by Yuri Chornoivan.
Committed on 09/11/2018 at 21:48.
Pushed by yurchor into branch 'Applications/18.12'.

Fix using comma decimal separator in multiple argument functions
Differential Revision: https://phabricator.kde.org/D16775

M  +4    -1    kmplot/parser.cpp

https://commits.kde.org/kmplot/817c8700db18c19474095e4e4ffb025040b98491