summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcd.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcd.nix b/gcd.nix
index 385793c..23a2d14 100644
--- a/gcd.nix
+++ b/gcd.nix
@@ -21,10 +21,9 @@ trace: gcd2: 11 <-> 0
list:
let
- inherit (builtins) div toString trace
- tail head;
+ inherit (builtins) trace tail head;
- rem = x: y: x - y*(div x y);
+ rem = x: y: x - y*(x / y);
gcd2 = x: y: trace "gcd2: ${toString x} <-> ${toString y}"
(if y == 0 then x else gcd2 y (rem x y));