Impressum/Kontaktparent nodes: implemented functions

⌊ Lesser of

testAplLesserOf
| table1 table2 result table3 |
"http://www.microapl.co.uk/apl_help/ch_020_020_120.htm"

"dataA aplLesserOf: dataB"

"Finds the smaller of two numbers. Each number in the dataA argument is compared with the corresponding number in the dataB argument. The result is the smaller number from each comparison."
self assert: 87 asApl = (87 asApl aplLesserOf: 91).

"The negative number further from 0 is considered the smaller"
self assert: -9 asApl = (-5 asApl aplLesserOf: -9).

"Each number in a vector is compared with the corresponding number in a vector of equal size"
self assert: #(20 3 40) asApl = (#(20 7 40) asApl aplLesserOf:#( 91 3 41)).

table1 := #(0 -3 66 9 16 4) aplReshape:#(2 3).
table2 :=#(12 -8 17 7 0 1) aplReshape:#(2 3).
result :=#( 0 -8 17 7 0 1) aplReshape:#(2 3).

"Each number in a matrix is compared with the corresponding number in a matrix with the same number of rows and columns"
self assert: result = (table1 aplLesserOf: table2).

"Each element in the dataB is compared with 2"
table3 := {1. 4 aplInterval aplReshape:#(2 2). 3 aplInterval. } asApl.
result := {1. #(1 2 2 2). #(1 2 2)} asApl.
self assert: result = (2 asApl aplLesserOf: table3).