about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index a0ada0233c59..1a0443cb6012 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -40,6 +40,11 @@ fn pure_builtins() -> Vec<Builtin> {
 
             Ok(Value::List(NixList::construct(output.len(), output)))
         }),
+        Builtin::new("div", 2, |mut args| {
+            let b = args.pop().unwrap();
+            let a = args.pop().unwrap();
+            Ok(arithmetic_op!(a, b, /))
+        }),
         Builtin::new("isAttrs", 1, |args| {
             Ok(Value::Bool(matches!(args[0], Value::Attrs(_))))
         }),
@@ -70,6 +75,11 @@ fn pure_builtins() -> Vec<Builtin> {
         Builtin::new("isString", 1, |args| {
             Ok(Value::Bool(matches!(args[0], Value::String(_))))
         }),
+        Builtin::new("mul", 2, |mut args| {
+            let b = args.pop().unwrap();
+            let a = args.pop().unwrap();
+            Ok(arithmetic_op!(a, b, *))
+        }),
         Builtin::new("sub", 2, |mut args| {
             let b = args.pop().unwrap();
             let a = args.pop().unwrap();