package frama-c

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val packed_descr : Structural_descr.pack
val hash : t -> int
val pretty : Stdlib.Format.formatter -> t -> unit
val is_exact : prec -> bool

Is the representation of floating-point numbers of a given precision exact? Should at least be false for Real.

val of_float : round -> prec -> float -> t

Converts a caml float into a floating-point number of the given precision. Must work on infinities and on negative and positive zeros.

val to_float : t -> float

Converts a floating-point number of single or double precision into a caml float. Never called on better precision than double.

val cmp_ieee : t -> t -> int

IEEE comparison: do not distinguish between -0.0 and 0.0. This comparison must work between values of different precisions.

val compare : t -> t -> int

Comparison that distinguishes -0.0 and 0.0. This comparison must work between values of different precisions.

val is_nan : t -> bool
val is_finite : t -> bool
val is_infinite : t -> bool
val is_negative : t -> bool

Is a number negative? Never called on NaN, but must be correct on infinities and zeros.

val round_to_precision : round -> prec -> t -> t

Rounds a number to a given precision.

val next_float : prec -> t -> t

First value above the argument in the given precision. Returns the minimum finite value on -infty. Returns +0 on -0, and the minimum strictly positive value on +0. Returns +infty on the maximum finite value. Returns +infty on +infty. Undefined on NaN.

val prev_float : prec -> t -> t

First value below the argument in the given precision. Inversed behavior as next_float.

type widen_hints = Widen_Hints.t
val widen_up : widen_hints -> prec -> t -> t

widen_up f returns a value strictly larger than f, such that successive applications of widen_up converge rapidly to infinity. The first arguments give the set of steps that could be used.

val widen_down : widen_hints -> prec -> t -> t

Floating-point operations.

val neg : t -> t
val abs : t -> t
val floor : t -> t
val ceil : t -> t
val trunc : t -> t
val fround : t -> t
val add : round -> prec -> t -> t -> t
val sub : round -> prec -> t -> t -> t
val mul : round -> prec -> t -> t -> t
val div : round -> prec -> t -> t -> t
val fmod : round -> prec -> t -> t -> t
val exp : round -> prec -> t -> t
val log : round -> prec -> t -> t
val log10 : round -> prec -> t -> t
val sqrt : round -> prec -> t -> t
val pow : round -> prec -> t -> t -> t
val cos : round -> prec -> t -> t
val sin : round -> prec -> t -> t
val acos : round -> prec -> t -> t
val asin : round -> prec -> t -> t
val atan : round -> prec -> t -> t
val atan2 : round -> prec -> t -> t -> t
OCaml

Innovation. Community. Security.