Expand/Shrink

smallest

Definition: object x1 = smallest(sequence set, bool return_index=false)
Description: Returns the smallest element of set.

set: the sequence in which to find the smallest element.
return_index: if false (0), returns s[i], otherwise returns i.

The largest function is identical except that it returns the largest element.
pwa/p2js: Supported.
Example:
?smallest({"this",{3,5,7},9})       -- prints 9
?largest({"this",{3,5,7},9})        -- prints "this"
Implementation: See builtins\psmall.e (an autoinclude) for details of the actual implementation.
See Also: min
Expand/Shrink