package mopsa
Install
Dune Dependency
Authors
Maintainers
Sources
md5=9f673f79708b44a7effb3b6bb3618d2c
sha512=cb91cb428e43a22f1abbcb8219710d0c10a5b3756d0da392d4084b3b3a6157350776c596983e63def344f617d39964e91f244f60c07958695ee5c8c809a9f0f4
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.