Impressum/Kontaktparent nodes: implemented functions

⌊ Floor

testAplFloor
| table result data |
"http://www.microapl.co.uk/apl_help/ch_020_020_110.htm"

"data aplFloor"

"The number or numbers in the right-hand argument are rounded down to the next whole number."
self assert: 45 asApl = 45.9 asApl aplFloor.

"Note the effect on a negative number"
self assert: -3 asApl = -2.3 asApl aplFloor.

"Each number in a vector is rounded down"
self assert: #(1 -1 99 2) asApl = #(1.2 -0.3 99.1 2.8) asApl aplFloor.

"0.5 is added to each number before aplFloor is applied to it, ensuring 'true' rounding"
self assert: #(1 0 99 3) asApl = (0.5 asApl + #(1.2 -0.3 99.1 2.8) )aplFloor.

table := #(62.8 3.0 -2.9 9.1 7.3 0.01) aplReshape:#(2 3).
result := #(62 3 -3 9 7 0) aplReshape:#(2 3).

"Each number in table is rounded down"
self assert: result = table aplFloor.

data := {#(-0.1 -10.1 11.3 7.4). #(-0.3 2.8 99.1 -2.3) aplReshape:#(2 2).} asApl.
result := {#(-1 -11 11 7). #(-1 2 99 -3) aplReshape:#(2 2).} asApl.

"Each element is rounded down"
self assert: result = data aplFloor.