You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now, I cannot do conditions and negation between two integers.
I tried to do this:
module Gcd;
open import Stdlib.Prelude;
open import Stdlib.Data.Nat.Ord;
If : Bool -> ℕ → ℕ → ℕ;
If true x _ := x;
If false _ x := x;
gcd : ℕ → ℕ → ℕ;
gcd a b :=
If (a == b)
a
(If (a > b)
(gcd a-b b)
(gcd a b-a));
end;
The text was updated successfully, but these errors were encountered:
I would like to write a simple
Gcd
function. It would look like this in python3:For now, I cannot do conditions and negation between two integers.
I tried to do this:
The text was updated successfully, but these errors were encountered: