From f428af9b50e79eb128fdd05b754d4d5512625440 Mon Sep 17 00:00:00 2001 From: bruno Date: Tue, 19 Jun 2018 17:42:14 +0200 Subject: [PATCH] Protocol environment / Int32: update to 4.06.1 --- .../sigs/v1/int32.mli | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/lib_protocol_environment/sigs/v1/int32.mli b/src/lib_protocol_environment/sigs/v1/int32.mli index eb0933726..4b85af947 100644 --- a/src/lib_protocol_environment/sigs/v1/int32.mli +++ b/src/lib_protocol_environment/sigs/v1/int32.mli @@ -15,7 +15,7 @@ (* TEZOS CHANGES - * Import version 4.04.0 + * Import version 4.06.1 * Remove deprecated functions *) @@ -91,7 +91,7 @@ external logxor : int32 -> int32 -> int32 = "%int32_xor" (** Bitwise logical exclusive or. *) val lognot : int32 -> int32 -(** Bitwise logical negation *) +(** Bitwise logical negation. *) external shift_left : int32 -> int -> int32 = "%int32_lsl" (** [Int32.shift_left x y] shifts [x] to the left by [y] bits. @@ -135,13 +135,26 @@ external to_float : int32 -> float external of_string : string -> int32 = "caml_int32_of_string" (** Convert the given string to a 32-bit integer. - The string is read in decimal (by default) or in hexadecimal, - octal or binary if the string begins with [0x], [0o] or [0b] - respectively. - Raise [Failure "int_of_string"] if the given string is not + The string is read in decimal (by default, or if the string + begins with [0u]) or in hexadecimal, octal or binary if the + string begins with [0x], [0o] or [0b] respectively. + + The [0u] prefix reads the input as an unsigned integer in the range + [[0, 2*Int32.max_int+1]]. If the input exceeds {!Int32.max_int} + it is converted to the signed integer + [Int32.min_int + input - Int32.max_int - 1]. + + The [_] (underscore) character can appear anywhere in the string + and is ignored. + Raise [Failure "Int32.of_string"] if the given string is not a valid representation of an integer, or if the integer represented exceeds the range of integers representable in type [int32]. *) +val of_string_opt: string -> int32 option +(** Same as [of_string], but return [None] instead of raising. + @since 4.05 *) + + val to_string : int32 -> string (** Return the string representation of its argument, in signed decimal. *) @@ -173,4 +186,3 @@ val compare: t -> t -> int val equal: t -> t -> bool (** The equal function for int32s. @since 4.03.0 *) -