
min(+Vector, -Result)
-Result is min(+Vector)

   Evaluates the the arithmetic expressions in Vector and unifies their minimum
with Result.



Arguments
   Vector              A list, array or vector expression.
   Result              Output: number.

Type
   Arithmetic

Description

    Evaluates the the arithmetic expressions in Vector and unifies their minimum
    with Result.

    Vector must be a non-empty list, array or collection expression
    (as accepted by eval_to_list/2).  The elements of Vector must
    be numbers, and Result is the minimum of these numbers (converted
    to the widest type of the vector elements).

   This predicate can be used as a function in arithmetic expressions.
   In coroutining mode, if the list is only partly instantiated, the
   predicate delays until the list is complete.


Modes and Determinism
   min(+, -) is det

Modules
   This predicate is sensitive to its module context (tool predicate, see @/2).

Exceptions
     4 --- Vector is insufficiently instantiated (non-coroutining mode only).
     5 --- Vecotr is not a list, array, or vector expression.

Examples
   
Success:
      X is min([1,2,3]).                 % gives X = 1
      X is min([1,2.0,3]).               % gives X = 1.0

      X is min([](1,2,3)).               % gives X = 1

      A=[](4,5,6,7), X is min(A[2..3]).  % gives X = 5

Error:
      X is min([]).                      % type error


See Also
   is / 2, min / 3, max / 2, eval_to_list / 2
