Notifications
Clear all
[Closed] GetMinVal?
Apr 29, 2008 8:09 pm
Is there a GetMin A B function built into max that I can’t find the name for?
Here is how I’m doing it now:
fn getMinVal VarA VarB =
(
try
(
if VarA > VarB then
(
return VarB
)
else
(
return VarA
)
)
catch()
)
But it seems like there should be a built in function for returning a max or min value.
4 Replies
1 Reply
Yes
There is
amin val1 val2 .. valN
amax val1 val2 .. valN
-- OR
amin #(val1,val2,..,valN)
amax #(val1,val2,..,valN)
I prefer the latter form
( P.S. Help > Search > “minimum value” -> Array Values )
Apr 29, 2008 8:09 pm
You can also but them in an array and use the amin and amax commands to get the max or min values.
test = #(10,20)
minVal = amin test
-bnvm
Apr 29, 2008 8:09 pm
Ahhhhhhh it’s under array. I knew it had to exist somewhere.
(aMin 25 36)
returns: 25
Perfect!
That should be added as a link to Number Methods and Operators.