Module Tezt_mavryk.Tez

Helpers for dealing with units of mav.

Please note that none of the functions here perform any bounds checks.

type t

A unit of mav

val of_int : int -> t

Make t from the whole number of mav. This doesn't perform any bounds checks.

val of_mumav_int : int -> t

Make t from the whole number of micro mav. This doesn't perform any bounds checks.

val of_mumav_int64 : int64 -> t

Make t from the whole number of micro mav. This doesn't perform any bounds checks.

val zero : t

0 mav

val one : t

1 mav

val to_string : t -> string

Convert t to a string.

val mumav_int64 : t -> int64

Convert t to a mumav integer.

val to_float : t -> float

Convert t to a float of mav.

val to_mumav : t -> int

Convert t to an int.

val (+) : t -> t -> t

Addition. This doesn't perform any bounds checks.

val (-) : t -> t -> t

Subtraction. This doesn't perform any bound checks.

val (/!) : t -> int64 -> t

Division. This doesn't perform any bound checks.

  • raises Division_by_zero

    when the second operand is zero.

val parse_floating : string -> t

Parsing. Parse a floating point number of mav.

Any string of digits followed by an optional point and another string of digits should parse successfully, provided that the expressed number is within bounds allowed for mav (up to 6 decimal places). For example: "123.4356" will parse, while "1.24723953794217492" won't, because it's too precise.

val typ : t Tezt_wrapper.Check.typ

The mav Check.typ