Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logics-js: max function not working #35

Open
Pumuckl4630 opened this issue Jan 25, 2024 · 1 comment
Open

logics-js: max function not working #35

Pumuckl4630 opened this issue Jan 25, 2024 · 1 comment
Labels
bug Something isn't working logics-js

Comments

@Pumuckl4630
Copy link

Pumuckl4630 commented Jan 25, 2024

This test case:

max(3, 7, 2) == 7
#EXPECT:True

does not work in logics-js but it works in logics-py
The problem seems to be with the max function, because the min function works.

Here is a screenshot with the case in logics-js:
grafik

EDIT: The min function is not working correct too.
grafik
It seems that only the first value is taken into account

EDIT2: For the max function its the same like the min function, only the first value is taken into account

@phorward
Copy link
Member

EDIT2: For the max function its the same like the min function, only the first value is taken into account

Hehe, exactly that's the point: The call to the min() and max() is wrong as done here, it must be max((3, 7, 2)) rather than max(3, 7, 2). Latter one is a call with three parameters, but currently only the first parameter is taken and converted into a list, as the function accepts a list.

Anyway, this behavior is wrong. It should either be considered to take all parameters passed into account, or throw an error message when calling a function with too many parameters.

@phorward phorward added bug Something isn't working logics-js labels Jan 26, 2024
@phorward phorward changed the title logics-js: "max" function not working logics-js: max function not working Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logics-js
Projects
None yet
Development

No branches or pull requests

2 participants