package gsl

  1. Overview
  2. Docs

Module Gsl.IeeeSource

IEEE floating-point arithmetic

Representation of floating point numbers

Sourcetype ieee_type =
  1. | NAN
  2. | INF
  3. | NORMAL
  4. | DENORMAL
  5. | ZERO
Sourcetype float_rep = {
  1. sign : int;
  2. mantissa : string;
  3. exponent : int;
  4. ieee_type : ieee_type;
}
Sourceval rep_of_float : float -> float_rep
Sourceval print : float -> string

IEEE environment

Sourcetype precision =
  1. | SINGLE
  2. | DOUBLE
  3. | EXTENDED
Sourcetype rounding =
  1. | TO_NEAREST
  2. | DOWN
  3. | UP
  4. | TO_ZERO
Sourcetype exceptions =
  1. | MASK_INVALID
  2. | MASK_DENORMALIZED
  3. | MASK_DIVISION_BY_ZERO
  4. | MASK_OVERFLOW
  5. | MASK_UNDERFLOW
  6. | MASK_ALL
  7. | TRAP_INEXACT
Sourceval set_mode : ?precision:precision -> ?rounding:rounding -> exceptions list -> unit
Sourceval env_setup : unit -> unit

FPU status word

Sourcetype excepts =
  1. | FE_INEXACT
  2. | FE_DIVBYZERO
  3. | FE_UNDERFLOW
  4. | FE_OVERFLOW
  5. | FE_INVALID
  6. | FE_ALL_EXCEPT
Sourceval clear_except : excepts list -> unit
Sourceval test_except : excepts list -> excepts list
OCaml

Innovation. Community. Security.