项目作者: hannesm

项目描述 :
Unsigned integers for OCaml
高级语言: OCaml
项目地址: git://github.com/hannesm/usane.git
创建时间: 2016-08-21T17:59:58Z
项目社区:https://github.com/hannesm/usane

开源协议:Other

下载


Usane - unsigned integers for OCaml

%%VERSION%%
The behaviour of numbers (int, int32, int64) in OCaml is to be signed, and wrap
around on over/underflow. This library gives explicit access to the carry bit
by using compiler builtins. Other fine integer libraries, such as
integers library and
stdint) mirror the OCaml standard
library behaviour.

This library defines 8, 16, 32, and 64 bit unsigned integers which interoperates
well with the builtin types (int32, int64) by reusing their representation.
Arithmetic operations return the carry bit explicitly.

Some motivating examples are:

  1. # succ max_int
  2. - : int = -4611686018427387904
  3. # pred min_int
  4. - : int = 4611686018427387903
  5. # abs min_int
  6. - : int = -4611686018427387904

Usane comes with a extensive test suite to show the behaviour.

Currently this library is not released, I first want to a) use
ocb-stubblr (to get it to run on
MirageOS) and b) test on 32bit.

Documentation

Build Status

API Documentation is available online.