package checked_oint
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=c4dab38d7d8b37987679308225374fad
sha512=8d416cd33a030fab4722a155f10ae44b9080de20be761927c9bb20d1c35ec1668ff1774121861156d16735ca1a22ee850f3762e8f2df8d06257b75367fb2d91f
doc/checked_oint/Checked_oint/U128/index.html
Module Checked_oint.U128Source
The implementation of u128.
include S with type t = u128
The particular integer type.
The bitwise operations bit_not, bit_or, bit_and, bit_xor, shift_left, and shift_right assume that signed integers are represented in the two's complement notation.
NOTE: implementations may not support polymorphic comparison operators. Use equal and compare instead.
The number of bits of this integer type.
Whether this integer type is signed or not.
Constructs a value out of int; returns None on overflow/underflow.
Constructs a value out of string; returns None on overflow/underflow.
We allow the following classes of non-negative integers:
- Binary:
0b(0B) followed by a non-empty sequence of binary digits0and1. - Octal:
0o(0O) followed by a non-empty sequence of octal digits0, ...,7. - Decimal: a non-empty sequence of decimal digits
0, ...,9. - Hexadecimal:
0x(0X) followed by a non-empty sequence of decimal digits0, ...,9and lettersa, ...,f(A, ...,F).
(Currently, 128-bit integers can only be decimal.)
A negative integer is described by the - character followed by a well-formed non-negative integer.
All other combinations of characters will return None.
Performs left shifting; returns None on overflow/underflow.
Performs right shifting; returns None on overflow/underflow.
This is a logical shift for unsigned integer types and arithmetic shift for signed integer types.
Same as of_int but raises Out_of_range instead of returning None.
Same as of_string but raises Out_of_range instead of returning None.
Finds a successor; raises Out_of_range on overflow.
Finds a predecessor; raises Out_of_range on underflow.
Performs unary negation; raises Out_of_range on overflow/underflow.
Finds an absolute value; raises Out_of_range on overflow.
Performs addition; raises Out_of_range on overflow/underflow.
Performs subtraction; raises Out_of_range on overflow/underflow.
Performs multiplication; raises Out_of_range on overflow/underflow.
Performs division; raises Out_of_range on overflow/underflow.
Finds a remainder; raises Out_of_range on overflow/underflow.
Performs left shifting; raises Out_of_range on overflow/underflow.
Performs right shifting; raises Out_of_range on overflow/underflow.
This is a logical shift for unsigned integer types and arithmetic shift for signed integer types.
Projects u128 into the high and low parts, respectively.
This function is useful for generating 128-bit literals from within C code. Suppose that U128.split x is (high, low); in order to obtain the original x, one can write the following C expression:
((unsigned __int128)high << 64 | (unsigned __int128)low)