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

min() and max(): Wrong result if parameter is a function #134

Open
Joe7M opened this issue Feb 28, 2022 · 1 comment
Open

min() and max(): Wrong result if parameter is a function #134

Joe7M opened this issue Feb 28, 2022 · 1 comment

Comments

@Joe7M
Copy link
Contributor

Joe7M commented Feb 28, 2022

If you have a function wich returns an array and you want to know the minimum or maximum value of that returned array, then you can't use the function as the parameter for min() or max(). You always have to do an additional step of saving into a variable.

func TestFunction(byref A)
    TestFunction = 5*A
end func

A = seq(1,3,3)

Result1 = min(TestFunction(A))
print Result1  'Prints [5,10,15]

'Workaround
temp = TestFunction(A)
Result2 = min(temp)
print Result2  'Prints 5
@Joe7M
Copy link
Contributor Author

Joe7M commented Feb 28, 2022

I have checked the source code, but I don't think I can fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant