<. y (Floor)

Back to: Vocabulary

The monadic form of <. gives the floor of its right argument (y) , that is, the largest integer less than or equal to y.

For example:

   <. 4.6
4
   <. 4.2 4.5 4.6
4 4 4
   <. 4.6 4 _4 _4.6
4 4 _4 _5

Common uses

Floor (and Ceiling (<.)) can also be useful for testing whether values are integers or not.

   3 3.14 5 = <. 3 3.14 5
1 0 1

Floor (and Ceiling (<.)) can be useful for forcing floating point representations of integers to be integers in order to save memory (8 vs 4 bytes per value). Values like this can arise as a result of operations like Divide (%). For example:

   27 % 9
3
   datatype 27 % 9
floating
   <. 27 % 9               NB. or:  27 <.@:% 9
3
   datatype <. 27 % 9
integer

See Also


x <. y (Lesser of (Min))

Back to: Vocabulary

The dyadic form of <. gives the lesser of its left (x) and right (y) arguments.

For example:

   3 <. 4
3
   3 <. 4 _4
3 _4
   2 3 <. 4 1
2 1

Common uses

<. can be used in conjunction with Insert (/) to find the minimum value in a list.

   <./ 7 8 5 9 2          NB. minimum value in a list
2
    
   <./\ 7 8 5 9 2         NB. running minimum
7 7 5 5 2

See Also


CategoryVoc CategoryWorkInProgress

Vocabulary/ltdot (last edited 2011-03-17 14:14:14 by IanClark)