Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7d19c731619e5b1090f450bc56d435bb6c8279267b4783e2089c27d17d08dff2
Description
Signed and Unsigned fixed point operations, with a full complement of rounding and overflow functionality.
Added to opam-repository:
README
"Fixed point arithmetic types"
hardcaml_fixed_point
A simple fixed point library for Hardcaml.
Numbers are represented in a [I.F] format which provides [I] integer bits and [F] fractional bits. We require [I>0] and [F>=0].
Seperate modules for Signed and Unsigned fixed point numbers are implemented.
The basic arithmetic operators are provided which ensure no overflow is possible and track precision.
Comparisions do not require the same precision for each argument.
The most important function is [resize]. This can increase or decrease [I] and [F]. When increasing appropriate padding is performed. When decreasing [I] the result can either [saturate] or [wrap]. When decreasing [F] a rounding function can be specified:
neg_infinitypos_infinityto_zeroaway_from_zerotie_to_neg_infinitytie_to_pos_infinitytie_to_zerotie_away_from_zerotie_to_nearest_eventie_to_nearest_odd
Note that [wrap] along with rounding to [neg_infinity] is effectively just truncating the top and bottom bits and uses no hardware.
Dependencies (5)
Dev Dependencies
None
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building hardcaml_fixed_point with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| v0.17.0 (this version) | n/a | n/a | good | good | good |
| v0.16.0 | n/a | good | good | n/a | n/a |
| v0.15.0 | good | good | good | n/a | n/a |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure