2 min - minimum, or minimum of defined minima
13 If an argument x_i is a list with elements e_1, e_2, ..., e_n, it
14 is treated as if x_i were replaced by e_1, e_2, ..., e_n; this may
15 continue recurively if any of the e_j is a list.
17 If an argument x_i is an object of type xx, then x_i is replaced by
18 xx_min(x_i) if the function xx_min() has been defined. If the
19 type xx has been defined by:
23 an appropriate definition of xx_min(a) is sometimes min(a.x, a.y, a.z).
24 min(a) then returns the minimum of the elements of a.
26 If x_i has the null value, it is ignored. Thus, sum(a, , b, , c)
28 If x_i has the null value, it is ignored. Thus, min(a, , b, , c)
29 will return the same as min(a, b, c).
31 Assuming the above replacements, and that the x_1, x_2, ..., are
32 of sufficently simple ordered types (e.g. real numbers or strings),
33 or, if some are objects, the relevant xx_rel(a,b) has been defined
34 and returns a real-number value for any comparison that has to be made,
35 min(x_1, x_2, ...) returns the value determined by min(x_1) = x_1,
36 and succesively for later arguments, by the use of the equivalent of
37 min(a,b) = (a < b) ? a : b. If the ordering determined by < is total,
38 min(x_1, ...) will be the minimum value among the arguments. For a
39 preorder relation it may be one of several minimal values. For other
40 relations, it may be difficult to predict the result.
43 > print min(2), min(5, 3, 7, 2, 9), min(3.2, -0.5, 8.7, -1.2, 2.5)
46 > print min(list(3,5), 7, list(6, list(7,8), 2))
49 > print min("one", "two", "three", "four")
53 > define point_rel(a,b) = sgn(a.x - b.x)
54 > obj point A = {1, 5}
55 > obj point B = {1, 4}
56 > obj point C = {3, 3}
60 > define point_min(a) = a.x
65 The number of arguments is not to exceed 100.
68 NUMBER *qmin(NUMBER *x1, NUMBER *x2)