diff --git a/gitlab-pages/docs/reference/toplevel.md b/gitlab-pages/docs/reference/toplevel.md index 91a39aa3b..ce19cfa08 100644 --- a/gitlab-pages/docs/reference/toplevel.md +++ b/gitlab-pages/docs/reference/toplevel.md @@ -65,7 +65,7 @@ function failwith : string -> unit val failwith : string -> unit -let failwith : string => unit +let failwith: string => unit Cause the contract to fail with an error message. @@ -80,7 +80,48 @@ function assert : bool -> unit val assert : bool -> unit -let assert : bool => unit +let assert: bool => unit Check if a certain condition has been met. If not the contract will fail. + + +function ediv : int -> int -> option (int * nat) + + +function ediv : mutez -> nat -> option (mutez * mutez) + + +function ediv : mutez -> mutez -> option (nat * mutez) + + +function ediv : nat -> nat -> option (nat * nat) + + + +val ediv : int -> int -> (int * nat) option + + +val ediv : mutez -> nat -> (mutez * mutez) option + + +val ediv : mutez -> mutez -> (nat * mutez) option + + +val ediv : nat -> nat -> (nat * nat) option + + + +let ediv: (int, int) => option((int, nat)) + + +let ediv: (mutez, nat) => option((mutez, mutez)) + + +let ediv: (mutez, mutez) => option((nat, mutez)) + + +let ediv: (nat, nat) => option((nat, nat)) + + +Compiles to Michelson `EDIV`, one operation to get both the quotient and remainder of a division. `ediv x y` returns None if `y` is zero, otherwise returns `Some (quotient, remainder)` such that `x = (quotient * y) + remainder` and `0 <= remainder < abs(y)`.