## — Ceiling

One-argument form See also two-argument form Greater of

The number or numbers in the right-hand argument are rounded up to the next whole number.

                 — 45.9
           46
                 — ¯3.8                   (Note effect of rounding up on a
           ¯3                              negative number)
                 —1.2 ¯0.3 99.1 2.8       (Each number in a vector is rounded up)
           2 0 100 3
                 —¯0.5+1.2 ¯0.3 9.1 2.8   (0.5 is subtracted from each number
           1 0 9 3                         before — is applied, producing
                                           'true' rounding)
                TABLE
           62.8  3.0  ¯2.9
            9.1  7.3   0.01
                 — TABLE                  (Each number in TABLE is rounded up)
           63 3 ¯2
           10 8  1
                 —(1.7 11.99 ¯2.3) (2 2½¯1.1 17.3 ¯0.1 103.4)
            2 12 ¯2     ¯1  18            (Each element is rounded up)
                         0 104

#### Comparison tolerance

When acting on a number which is very close to but slightly bigger than an integer, Ceiling may round down to that integer rather than round up. This will happen if the argument is within comparison tolerance of the integer, and is therefore considered in APL to be equal to it.

#### Effect on internal representation

See the description of ˜ Floor for information on the internal representation of the result of Ceiling.

Topic: APLX Help : Help on APL language : APL Primitives : — Ceiling

[ Previous | Next | Contents | Index ]