1 USING: kernel math math.compare math.functions sequences
6 { -1 } [ -1 5 absmin ] unit-test
7 { -1 } [ -1 -5 absmin ] unit-test
9 { -5 } [ 1 -5 absmax ] unit-test
10 { 5 } [ 1 5 absmax ] unit-test
12 { 0 } [ -1 -3 posmax ] unit-test
13 { 1 } [ 1 -3 posmax ] unit-test
14 { 3 } [ -1 3 posmax ] unit-test
16 { 0 } [ 1 3 negmin ] unit-test
17 { -3 } [ 1 -3 negmin ] unit-test
18 { -1 } [ -1 3 negmin ] unit-test
20 { 1 } [ 1 2 [ ] min-by ] unit-test
21 { 1 } [ 2 1 [ ] min-by ] unit-test
22 { 42.0 } [ 42.0 1/0. [ ] min-by ] unit-test
23 { 42.0 } [ 1/0. 42.0 [ ] min-by ] unit-test
24 { 2 } [ 1 2 [ ] max-by ] unit-test
25 { 2 } [ 2 1 [ ] max-by ] unit-test
26 { 1/0. } [ 42.0 1/0. [ ] max-by ] unit-test
27 { 1/0. } [ 1/0. 42.0 [ ] max-by ] unit-test
28 { "12345" } [ "123" "12345" [ length ] max-by ] unit-test
29 { "123" } [ "123" "12345" [ length ] min-by ] unit-test