package tezos-protocol-003-PsddFKi3

  1. Overview
  2. Docs
Tezos/Protocol: 003_PsddFKi3 (economic-protocol definition, functor version)

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.1.tar.gz
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f

doc/tezos-protocol-003-PsddFKi3.raw/Tezos_raw_protocol_003_PsddFKi3/Script_int_repr/index.html

Module Tezos_raw_protocol_003_PsddFKi3.Script_int_reprSource

Sourcetype 't num

The types for arbitraty precision integers in Michelson. The type variable 't is always n or z, n num and z num are incompatible.

This is internally a Z.t. This module mostly adds signedness preservation guarantees.

Sourceand n =
  1. | Natural_tag

Flag for natural numbers.

Sourceand z =
  1. | Integer_tag

Flag for relative numbers.

Sourceval zero_n : n num

Natural zero.

Sourceval zero : z num

Relative zero.

Sourceval compare : 'a num -> 'a num -> int

Compare two numbers as if they were

Sourceval to_string : _ num -> string

Conversion to an OCaml string in decimal notation.

Sourceval of_string : string -> z num option

Conversion from an OCaml string. Returns None in case of an invalid notation. Supports + and - sign modifiers, and 0x, 0o and 0b base modifiers.

Sourceval to_int64 : _ num -> int64 option

Conversion to an OCaml int64, returns None on overflow.

Sourceval of_int64 : int64 -> z num

Conversion from an OCaml int.

Sourceval to_int : _ num -> int option

Conversion to an OCaml int, returns None on overflow.

Sourceval of_int : int -> z num

Conversion from an OCaml int64.

Conversion from a Zarith integer (Z.t).

Conversion to a Zarith integer (Z.t).

Sourceval add_n : n num -> n num -> n num

Addition between naturals.

Sourceval mul_n : n num -> n num -> n num

Multiplication between naturals.

Sourceval ediv_n : n num -> n num -> (n num * n num) option

Euclidean division between naturals. ediv_n n d returns None if divisor is zero, or Some (q, r) where n = d * q + r and [0 <= r < d] otherwise.

Sourceval add : _ num -> _ num -> z num

Sign agnostic addition. Use add_n when working with naturals to preserve the sign.

Sourceval sub : _ num -> _ num -> z num

Sign agnostic subtraction. Use sub_n when working with naturals to preserve the sign.

Sourceval mul : _ num -> _ num -> z num

Sign agnostic multiplication. Use mul_n when working with naturals to preserve the sign.

Sourceval ediv : _ num -> _ num -> (z num * n num) option

Sign agnostic euclidean division. ediv n d returns None if divisor is zero, or Some (q, r) where n = d * q + r and [0 <= r < |d|] otherwise. Use ediv_n when working with naturals to preserve the sign.

Sourceval abs : z num -> n num

Compute the absolute value of a relative, turning it into a natural.

Sourceval is_nat : z num -> n num option

Partial identity over N.

Sourceval neg : _ num -> z num

Negates a number.

Sourceval int : n num -> z num

Turns a natural into a relative, not changing its value.

Sourceval lognot : _ num -> z num

Reverses each bit in the representation of the number. Also applies to the sign.

Sourceval shift_left_n : n num -> n num -> n num option

Shifts the natural to the left of a number of bits between 0 and 256. Returns None if the amount is too high.

Sourceval shift_right_n : n num -> n num -> n num option

Shifts the natural to the right of a number of bits between 0 and 256. Returns None if the amount is too high.

Sourceval shift_left : 'a num -> n num -> 'a num option

Shifts the number to the left of a number of bits between 0 and 256. Returns None if the amount is too high.

Sourceval shift_right : 'a num -> n num -> 'a num option

Shifts the number to the right of a number of bits between 0 and 256. Returns None if the amount is too high.

Sourceval logor : 'a num -> 'a num -> 'a num

Applies a boolean or operation to each bit.

Sourceval logand : _ num -> n num -> n num

Applies a boolean and operation to each bit.

Sourceval logxor : n num -> n num -> n num

Applies a boolean xor operation to each bit.

OCaml

Innovation. Community. Security.