floor

From The K Language Wiki
Revision as of 11:19, 11 July 2021 by Razetime (talk | contribs) (add floor page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Floor
_x

The floor function is used to round numbers down in K.

Flooring is a no-op on integers and characters, meaning that they remain the same.

The floor primitive is right atomic.

A ceiling function (round up) can be made with floor as well: (1+_)

 _3
3

 _-3.7 4.789 80 0n
-4 4 80 0N