Skip to content

Min

Name - Description Default Type
<input> Any valid integer(s), floating point number(s), or a sequence of such entities supported by this operation. IntInt2Int3Int4Int8Int16FloatFloat2Float3Float4Color[Any]
<output> The result of the operation, usually in the same type as the input value. IntInt2Int3Int4Int8Int16FloatFloat2Float3Float4Color[Any]
Operand The operand for this operation. 0 Int&IntInt2&Int2Int3&Int3Int4&Int4Int8&Int8Int16&Int16Float&FloatFloat2&Float2Float3&Float3Float4&Float4Color&Color[Any]&[Any]

Applies the binary operation on the input value and the operand and returns the result (or a sequence of results if the input and the operand are sequences).

Details

This shard compares the input to its :Operand parameter and outputs the lesser of the two values.

If the input is a sequence and the :Operand a single number, each input element is compared with the :Operand and the lesser value from each comparison is collected and output as a sequence.

If the input and :Operand both are sequences, each element of the input sequence is compared with the corresponding-index element in the :Operand sequence and the lesser value from each comparison is collected and output as a sequence.

If the input sequence is smaller in size than the :Operand sequence the comparison stops with the last element of the input sequence. If the :Operand sequence is smaller the remaining input sequence elements loop over the :Operand sequence till all input sequence elements have been compared.

This shard works only on numbers (integers, floats) and on sequences of such numbers. The data types of the input and the :Operand parameters must match.

See also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;; sequence vs number
(Const [-1 0 1 2 5])
(Min
 ;:Operand
 3)
(Assert.Is [-1 0 1 2 3] true)

;; number vs number
(Const 3)
(Min
 ;:Operand
 2)
(Assert.Is 2 true)

;; sequence (equal) vs sequence (equal)
(Const [-1 0 1 2 5])
(Min
 ;:Operand
 [3 -2 4 0 1])
(Assert.Is [-1 -2 1 0 1] true)

;; sequence (smaller) vs sequence (bigger)
(Const [-1 0 5])
(Min
 ;:Operand
 [3 -2 4 0 1])
(Assert.Is [-1 -2 4] true)

;; sequence (bigger) vs sequence (smaller)
(Const [-1 0 1 2 5])
(Min
 ;:Operand
 [3 -2 1])
(Assert.Is [-1 -2 1 2 -2] true)