min#
Return the numerically smallest value in the list.
Σύνοψη#
my $lo = min @values;
my $lo = min 3, 9, 12; # 3
Τι επιστρέφεται#
A single number. If every argument is an integer the result is returned as an integer; otherwise it is returned as a float. An empty list yields undef.
Παραδείγματα#
my $n = min 1..10; # 1
my $n = min @bar, @baz; # smallest across concatenated lists
my $n = min(); # undef
Οριακές περιπτώσεις#
Empty list returns
undef.Strings are compared numerically (use
minstrfor lexical order).
Διαφορές από το upstream#
Fully compatible with upstream.
Δείτε επίσης#
max- the numerical maximum counterpart.minstr- string-wise minimum (ltsemantics).reduce- custom minima (e.g. by a key function).