[ Arithmetic | Reference Manual | Alphabetic Index ]

min(+Number1, +Number2, -Minimum)

Unifies the minimum of Number1 and Number2 with Minimum.
Number1
A number.
Number2
A number.
Minimum
Output: a number.

Description

This predicate is used by the ECLiPSe compiler to expand evaluable arithmetic expressions. So the call to min(Number1, Number2, Minimum) is equivalent to
Minimum is min(Number1, Number2)
which should be preferred for portability.

In coroutining mode, if Number1 or Number2 are uninstantiated, the call to min/3 is delayed until these variables are instantiated.

Modes and Determinism

• min(+, +, -) is det

Exceptions

(4) instantiation fault
Number1 or Number2 is not instantiated (non-coroutining mode only).
(24) number expected
Number1 or Number2 is not of a numeric type.

Examples

Result is min(5, 2).	% gives Result = 2
Result is min(2_3, 3_4).	% gives Result = 2_3
Result is min(5.0, 2.0).	% gives Result = 2.0
Result is min(5.0, 2).	% gives Result = 2.0 (the types are adjusted)
Result is min(5_0, 2).	% gives Result = 2_0 (the types are adjusted)