Core Function Min
From Sputnik Wiki
(Difference between revisions)
m (1 revision) |
|||
(3 intermediate revisions by one user not shown) | |||
Line 23: | Line 23: | ||
=== Remarks === | === Remarks === | ||
− | + | You can add infinitely more expressions and compare them all to find the min. | |
=== Example === | === Example === | ||
Line 30: | Line 30: | ||
$y = min(50, 100); | $y = min(50, 100); | ||
println( "Value is: $y " ); //prints 50 | println( "Value is: $y " ); //prints 50 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Example of comparing many values | ||
+ | <syntaxhighlight lang="sputnik"> | ||
+ | $y = Min(8, 2, 7, 3, 1, 4, 5) | ||
+ | println( "Value is: $y " ); //prints 1 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Latest revision as of 12:38, 14 June 2015
Min( <expression>, <expression2> )
Contents |
Description
Find the lesser number and return it
Parameters
expression
Any valid numeric expression.
expression2
Any valid numeric expression.
Return Value
Compares 2 numbers and returns the lowest number.
Remarks
You can add infinitely more expressions and compare them all to find the min.
Example
$y = min(50, 100); println( "Value is: $y " ); //prints 50
Example of comparing many values
$y = Min(8, 2, 7, 3, 1, 4, 5) println( "Value is: $y " ); //prints 1