module Floating_point: sig .. end
val set_round_downward : unit -> unit
val set_round_upward : unit -> unit
val set_round_nearest_even : unit -> unit
val round_to_single_precision_float : float -> float
val max_single_precision_float : float
val most_negative_single_precision_float : float
val sys_single_precision_of_string : string -> float
type parsed_float = {
|
f_nearest : float; |
|
f_lower : float; |
|
f_upper : float; |
}
If
s is parsed as
(n, l, u), then
n is the nearest approximation of
s with the desired precision. Moreover,
l and
u are the
most precise float such that
l <= s <= u, again with this precision.
Consistent with logic_real definition in Cil_types.
val single_precision_of_string : string -> parsed_float
val double_precision_of_string : string -> parsed_float
val parse_kind : Cil_types.fkind -> string -> parsed_float
val pretty_normal : use_hex:bool -> Format.formatter -> float -> unit
val pretty : Format.formatter -> float -> unit
type sign =
exception Float_Non_representable_as_Int64 of sign
val truncate_to_integer : float -> Integer.t
Raises Float_Non_representable_as_Int64 if the float value cannot
be represented as an Int64 or as an unsigned Int64.
val bits_of_max_double : Integer.t
binary representation of -DBL_MAX and DBL_MAX as 64 bits signed integers
val bits_of_most_negative_double : Integer.t
val bits_of_max_float : Integer.t
binary representation of -FLT_MAX and FLT_MAX as 32 bits signed integers
val bits_of_most_negative_float : Integer.t