lix/tests/lang/eval-okay-floor-ceil.nix
Maximilian Bosch 7f7f99f350
Implement builtins.floor and builtins.ceil using the C library functions internally
Closes #4782

Note: even though the type is internally called `NixFloat`, it's
actually a `double`.
2021-05-10 12:19:32 +02:00

9 lines
200 B
Nix

with import ./lib.nix;
let
n1 = builtins.floor 23.5;
n2 = builtins.ceil 23.5;
n3 = builtins.floor 23;
n4 = builtins.ceil 23;
in
builtins.concatStringsSep ";" (map toString [ n1 n2 n3 n4 ])