Skip to content

hannesm/usane

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

# succ max_int
- : int = -4611686018427387904

# pred min_int
- : int = 4611686018427387903

# abs min_int
- : 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.

About

Unsigned integers for OCaml

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published