1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

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`.
This commit is contained in:
Maximilian Bosch 2021-05-10 11:47:00 +02:00
parent db6ab75cae
commit 7f7f99f350
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
3 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1 @@
"23;24;23;23"

View file

@ -0,0 +1,9 @@
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 ])