Max and Min of list of series of variables

Posted By: degenerate_762

Max and Min of list of series of variables - 12/31/21 17:03

yo my peoples,

I have a series of independent variables. I'm trying to sort them to return the minimum and maximum of each respective parameter. I have looked through the manual to find that the min and max functions have already been implemented. However, the function only accepts to evaluate two inputs to return the min and max. Please, Is there a way i could have more than two inputs?

Code
max(var x, var y): var

Parameters:
x,y - any var or int.

Returns:
The minimum or maximum of x and y. 


Attached picture FH5DD3fXEAIE9Mm.jpg
Posted By: Grant

Re: Max and Min of list of series of variables - 12/31/21 19:19

Yes, by using a for() loop. You can find a couple of variations over here. As a simple alternative you can also use the min/max functions in R or any other language like Python.
Posted By: degenerate_762

Re: Max and Min of list of series of variables - 12/31/21 20:30

Code
vars crosses1 = series(0);
if (1 == 1){
if (...){
...}
}


Yes. Was looking for a cleaner implementation from people smarter than me (i.e zorro team and you respectful Sir).
Posted By: Spirit

Re: Max and Min of list of series of variables - 01/01/22 13:38

Look for MinVal and MaxVal.
Posted By: Grant

Re: Max and Min of list of series of variables - 01/01/22 17:00

Nice, I overlooked that nifty one.
© 2024 lite-C Forums