package checked_oint
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
An OCaml library for checked integer arithmetic
Install
dune-project
Dependency
Authors
Maintainers
Sources
checked_oint-0.4.1.tar.gz
md5=b480b179cbf345bb7c2e8400561cb725
sha512=1bb1de3bc4f812fc00e98c51d2a01697b3edb9be7cf14969ccd9e1e7a41f4e94d6a78c293053b3fe4387393446ac021912d56aaef4e1049f952bf265d3e47111
doc/README.html
checked_oint
checked_oint is an OCaml library for checked integer arithmetic. We support the full set of signed and unsigned integers of bitnesses 8, 16, 32, 64, and 128.
Installation
$ opam install checked_ointUsage
open Checked_oint
let () =
let x = U8.of_int_exn 50 in
let y = U8.of_int_exn 70 in
assert (U8.equal (U8.add_exn x y) (U8.of_int_exn 120));
assert (Option.is_none (U8.mul x y))You can find the API documentation here.
Implementation
u8,u16,i8, andi16are represented asintinternally.u32andi32(resp.u64andi64) are represented asint32(resp.int64) internally.u128andi128are represented as{ high : int64; low : int64 }internally.- Operations on integers of 8, 16, 32, and 64 bits are implemented primarily in OCaml, save a small amount of C stub functions.
Operations on 128-bit integers are implemented solely in C.
- We heavily rely on the
__int128extension by GCC and Clang.
- We heavily rely on the
Release procedure
- Update the
versionfield indune-project. - Type
dune buildto generatechecked_oint.opam. - Update
CHANGELOG.md. - Release the project in GitHub Releases.
- Type
git pull && opam publish.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page