package mopsa
Install
Dune Dependency
Authors
Maintainers
Sources
md5=fdee20e988343751de440b4f6b67c0f4
sha512=f5cbf1328785d3f5ce40155dada2d95e5de5cce4f084ea30cfb04d1ab10cc9403a26cfb3fa55d0f9da72244482130fdb89c286a9aed0d640bba46b7c00e09500
doc/itvUtils/ItvUtils/Float/index.html
Module ItvUtils.Float
Source
Float - Floating-point arihmetics with rounding.
We rely on C code to provide functions with correct rounding (rounding direction and rounding precision).
Types
type bit_float = {
sign : bool;
(*sign bit (true means negative)
*)fraction : Z.t;
(*fraction bits
*)exponent : int;
(*exponent (positive, with bias)
*)
}
Bit-representation of a float value.
Global rounding direction
Set the rounding mode globally. This affects the behaviors of all floating-point operations, including OCaml's native float operations, but excluding the operations in this module (and the float interval module) that specify a rounding direction.
Note that the operations with specified rounding directions may change the rounding direction globally in some unspecified way, and not reset it to its former value (this is done for efficiency).
Operations without rounding
Predicates
As sign, but zero is signed. Returns -1 (negative or -0), 0 (NaN), or 1 (positive of +0)
Printing
Control the printing of a float (precision, rounding, etc.).
Default format.
Operations with specific rounding direction and precision
We provide the classic operations (and more) for single and double precision and all four rounding directions.
Operations with rounding mode as argument
Precision.
Rounding direction.
Conversion from string, with safe rounding.
Useful constants.
Bit-level extraction.