package mopsa
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=37966e98ffeebcedc09bd6e9b2b81f69
sha512=40d4d826c25f680766c07eccbabdf5e8a4fa023016e8a164e4e4f6b3781c8484dc4df437055721dfd19b9db8fb7fe3b61236c4833186d346fc7204a68d01eaaa
doc/mopsa.mopsa_utils/Mopsa_utils/ItvUtils/IntBound/index.html
Module ItvUtils.IntBound
IntBound - Enriches arbitrary precision integers with +∞ and -∞.
Useful as interval bounds.
Types
Internal utilities
Constructors
val zero : t
val one : t
val minus_one : t
Useful constants
val of_int : int -> t
val of_int64 : int64 -> t
Exact conversion from machine integers.
val of_float : float -> t
Conversion with truncation from floats. Handles infinites. Raises an exception on NaNs.
val infinite : int -> t
Constructs an infinity with the given sign. Zero maps to zero.
val pow2 : int -> t
A power of two. The argument must be positive.
Predicates
val sign : t -> int
Sign of x: -1, 0, or 1.
val is_finite : t -> bool
Whether x is finite or not.
Total order. Returns -1 (strictly smaller), 0 (equal), or 1 (strictly greater).
val is_zero : t -> bool
val is_nonzero : t -> bool
val is_positive : t -> bool
val is_negative : t -> bool
val is_positive_strict : t -> bool
val is_negative_strict : t -> bool
Sign predicates.
val hash : t -> int
Hashing function.
Printing
val to_string : t -> string
val print : out_channel -> t -> unit
val fprint : Format.formatter -> t -> unit
Operators
Euclidian division. Always defined: 0 / 0 = 0, x / +∞ = 0, x / 0 = sign(x) * ∞
Remainder. rem x y has the sign of x, rem x (-y) = rem x y, and rem x +∞ = x. rem +∞ y and rem x 0 are undefined (invalid argument exception).
Euclidian remainder. erem x y >= 0, rem x y < |b| and a = b * ediv a b + erem a b. rem +∞ y and rem x 0 are undefined (invalid argument exception).
Left bitshift. Undefined if the second argument is negative (invalid argument exception). Returns an infinity if the second argument is too large.
Right bitshift, rounding towards -∞. Undefined if the second argument is negative (invalid argument exception). Returns zero if the second argument is too large.
Right bitshift, rounding towards 0 (truncation). Undefined if the second argument is negative (invalid argument exception). Returns zero if the second argument is too large.