Protocol: change external to val in zarith protocol env
This commit is contained in:
parent
3ca9a081f9
commit
67ac4d8f5c
@ -13,19 +13,19 @@ type t
|
|||||||
val zero: t
|
val zero: t
|
||||||
val one: t
|
val one: t
|
||||||
|
|
||||||
external abs: t -> t = "ml_z_abs" "ml_as_z_abs"
|
val abs: t -> t
|
||||||
(** Absolute value. *)
|
(** Absolute value. *)
|
||||||
|
|
||||||
external neg: t -> t = "ml_z_neg" "ml_as_z_neg"
|
val neg: t -> t
|
||||||
(** Unary negation. *)
|
(** Unary negation. *)
|
||||||
|
|
||||||
external add: t -> t -> t = "ml_z_add" "ml_as_z_add"
|
val add: t -> t -> t
|
||||||
(** Addition. *)
|
(** Addition. *)
|
||||||
|
|
||||||
external sub: t -> t -> t = "ml_z_sub" "ml_as_z_sub"
|
val sub: t -> t -> t
|
||||||
(** Subtraction. *)
|
(** Subtraction. *)
|
||||||
|
|
||||||
external mul: t -> t -> t = "ml_z_mul" "ml_as_z_mul"
|
val mul: t -> t -> t
|
||||||
(** Multiplication. *)
|
(** Multiplication. *)
|
||||||
|
|
||||||
val ediv_rem: t -> t -> (t * t)
|
val ediv_rem: t -> t -> (t * t)
|
||||||
@ -34,27 +34,27 @@ val ediv_rem: t -> t -> (t * t)
|
|||||||
Raises [Division_by_zero] if [b = 0].
|
Raises [Division_by_zero] if [b = 0].
|
||||||
*)
|
*)
|
||||||
|
|
||||||
external logand: t -> t -> t = "ml_z_logand" "ml_as_z_logand"
|
val logand: t -> t -> t
|
||||||
(** Bitwise logical and. *)
|
(** Bitwise logical and. *)
|
||||||
|
|
||||||
external logor: t -> t -> t = "ml_z_logor" "ml_as_z_logor"
|
val logor: t -> t -> t
|
||||||
(** Bitwise logical or. *)
|
(** Bitwise logical or. *)
|
||||||
|
|
||||||
external logxor: t -> t -> t = "ml_z_logxor" "ml_as_z_logxor"
|
val logxor: t -> t -> t
|
||||||
(** Bitwise logical exclusive or. *)
|
(** Bitwise logical exclusive or. *)
|
||||||
|
|
||||||
external lognot: t -> t = "ml_z_lognot" "ml_as_z_lognot"
|
val lognot: t -> t
|
||||||
(** Bitwise logical negation.
|
(** Bitwise logical negation.
|
||||||
The identity [lognot a]=[-a-1] always hold.
|
The identity [lognot a]=[-a-1] always hold.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
external shift_left: t -> int -> t = "ml_z_shift_left" "ml_as_z_shift_left"
|
val shift_left: t -> int -> t
|
||||||
(** Shifts to the left.
|
(** Shifts to the left.
|
||||||
Equivalent to a multiplication by a power of 2.
|
Equivalent to a multiplication by a power of 2.
|
||||||
The second argument must be non-negative.
|
The second argument must be non-negative.
|
||||||
*)
|
*)
|
||||||
|
|
||||||
external shift_right: t -> int -> t = "ml_z_shift_right" "ml_as_z_shift_right"
|
val shift_right: t -> int -> t
|
||||||
(** Shifts to the right.
|
(** Shifts to the right.
|
||||||
This is an arithmetic shift,
|
This is an arithmetic shift,
|
||||||
equivalent to a division by a power of 2 with rounding towards -oo.
|
equivalent to a division by a power of 2 with rounding towards -oo.
|
||||||
@ -64,22 +64,22 @@ external shift_right: t -> int -> t = "ml_z_shift_right" "ml_as_z_shift_right"
|
|||||||
val to_string: t -> string
|
val to_string: t -> string
|
||||||
val of_string: string -> t
|
val of_string: string -> t
|
||||||
|
|
||||||
external to_int64: t -> int64 = "ml_z_to_int64"
|
val to_int64: t -> int64
|
||||||
(** Converts to a 64-bit integer. May raise [Overflow]. *)
|
(** Converts to a 64-bit integer. May raise [Overflow]. *)
|
||||||
|
|
||||||
external of_int64: int64 -> t = "ml_z_of_int64"
|
val of_int64: int64 -> t
|
||||||
(** Converts from a 64-bit integer. *)
|
(** Converts from a 64-bit integer. *)
|
||||||
|
|
||||||
external to_int: t -> int = "ml_z_to_int"
|
val to_int: t -> int
|
||||||
(** Converts to a base integer. May raise an [Overflow]. *)
|
(** Converts to a base integer. May raise an [Overflow]. *)
|
||||||
|
|
||||||
external of_int: int -> t = "ml_z_of_int" [@@ noalloc]
|
val of_int: int -> t
|
||||||
(** Converts from a base integer. *)
|
(** Converts from a base integer. *)
|
||||||
|
|
||||||
external equal: t -> t -> bool = "ml_z_equal" [@@ noalloc]
|
val equal: t -> t -> bool
|
||||||
external compare: t -> t -> int = "ml_z_compare" [@@ noalloc]
|
val compare: t -> t -> int
|
||||||
|
|
||||||
external numbits: t -> int = "ml_z_numbits" [@@ noalloc]
|
val numbits: t -> int
|
||||||
(** Returns the number of significant bits in the given number.
|
(** Returns the number of significant bits in the given number.
|
||||||
If [x] is zero, [numbits x] returns 0. Otherwise,
|
If [x] is zero, [numbits x] returns 0. Otherwise,
|
||||||
[numbits x] returns a positive integer [n] such that
|
[numbits x] returns a positive integer [n] such that
|
||||||
|
Loading…
Reference in New Issue
Block a user