>. y (Ceiling)

Back to: Vocabulary

The monadic form of >. gives the ceiling of its right argument (y) , that is, the smallest integer greater than or equal to y.

For example:

   >. 4.6
5
   >. 4.2 4.5 4.6
5 5 5
   >. 4.6 4 _4 _4.6
5 4 _4 _4

Common uses

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

   3 3.14 5 = >. 3 3.14 5
1 0 1

Ceiling (and Floor (<.)) 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 (Larger of (Max))

Back to: Vocabulary

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

For example:

   3 >. 4
4
   3 >. 4 _4
4 3
   2 3 >. 4 1
4 3

Common uses

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

   >./ 7 8 5 9 2          NB. maximum value in a list
9
    
   >./\ 7 8 5 9 2         NB. running maximum
7 8 8 9 9

See Also


CategoryVoc CategoryWorkInProgress

Vocabulary/gtdot (last edited 2011-03-17 14:32:48 by IanClark)