Next: , Previous: , Up: baselib math ops   [Index]


4.6.4.4 Comparison

Procedure: max x1 x2
Procedure: min x1 x2

These procedures return the maximum or minimum of their arguments.

(max 3 4)               ⇒ 4
(max 3.9 4)             ⇒ 4.0

For any real number object x that is not a NaN:

(max +inf.0 x)    ⇒ +inf.0
(min -inf.0 x)    ⇒ -inf.0

NOTE If any argument is inexact, then the result is also inexact (unless the procedure can prove that the inaccuracy is not large enough to affect the result, which is possible only in unusual implementations). If min or max is used to compare number objects of mixed exactness, and the numerical value of the result cannot be represented as an inexact number object without loss of accuracy, then the procedure may raise an exception with condition type &implementation-restriction.