dhall-nix-lib/Number/toInteger.dhall

9 lines
244 B
Text

λ(nix : ../NixPrelude.dhall) →
let Number = ./Type.dhall
let Number/nonPositive = ./nonPositive.dhall nix
in λ(a : Number) →
if Number/nonPositive a
then nix.builtins.ceil a
else nix.builtins.floor a