about summary refs log tree commit diff
path: root/tvix/eval/src/builtins/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r--tvix/eval/src/builtins/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 336c320e2f00..91fe27aa4695 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -134,6 +134,9 @@ fn pure_builtins() -> Vec<Builtin> {
                 Ok(Value::List(NixList::construct(output.len(), output)))
             },
         ),
+        Builtin::new("ceil", &[true], |args: Vec<Value>, _: &mut VM| {
+            Ok(Value::Integer(args[0].as_float()?.ceil() as i64))
+        }),
         Builtin::new(
             "compareVersions",
             &[true, true],
@@ -269,6 +272,9 @@ fn pure_builtins() -> Vec<Builtin> {
                 .map(|list| Value::List(NixList::from(list)))
                 .map_err(Into::into)
         }),
+        Builtin::new("floor", &[true], |args: Vec<Value>, _: &mut VM| {
+            Ok(Value::Integer(args[0].as_float()?.floor() as i64))
+        }),
         Builtin::new(
             "foldl'",
             &[true, false, true],