package mopsa

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Float.SingleSource

Single precision operations.

Single precision numbers are stored inside OCaml's floats, that are actually double precion, but rounding is done to single precision.

Operations

Sourceval add_near : t -> t -> t
Sourceval add_up : t -> t -> t
Sourceval add_down : t -> t -> t
Sourceval add_zero : t -> t -> t

Addition

Sourceval sub_near : t -> t -> t
Sourceval sub_up : t -> t -> t
Sourceval sub_down : t -> t -> t
Sourceval sub_zero : t -> t -> t

Subtraction

Sourceval mul_near : t -> t -> t
Sourceval mul_up : t -> t -> t
Sourceval mul_down : t -> t -> t
Sourceval mul_zero : t -> t -> t

Multiplication

Sourceval mulz_near : t -> t -> t
Sourceval mulz_up : t -> t -> t
Sourceval mulz_down : t -> t -> t
Sourceval mulz_zero : t -> t -> t

Special multiplication where 0 times an infinity is 0, not NaN. This is particularly useful for interal bounds.

Sourceval div_near : t -> t -> t
Sourceval div_up : t -> t -> t
Sourceval div_down : t -> t -> t
Sourceval div_zero : t -> t -> t

Division

Sourceval divz_near : t -> t -> t
Sourceval divz_up : t -> t -> t
Sourceval divz_down : t -> t -> t
Sourceval divz_zero : t -> t -> t

Special division where 0 / 0 is 0, not NaN. This is particularly useful for interal bounds.

Sourceval mod_near : t -> t -> t
Sourceval mod_up : t -> t -> t
Sourceval mod_down : t -> t -> t
Sourceval mod_zero : t -> t -> t

Remainder.

Sourceval square_near : t -> t
Sourceval square_up : t -> t
Sourceval square_down : t -> t
Sourceval square_zero : t -> t

Square.

Sourceval sqrt_near : t -> t
Sourceval sqrt_up : t -> t
Sourceval sqrt_down : t -> t
Sourceval sqrt_zero : t -> t

Square root.

Sourceval round_int_near : t -> t
Sourceval round_int_up : t -> t
Sourceval round_int_down : t -> t
Sourceval round_int_zero : t -> t

Rounding to an integer.

Sourceval of_double_near : t -> t
Sourceval of_double_up : t -> t
Sourceval of_double_down : t -> t
Sourceval of_double_zero : t -> t

Rounding from double to single precision.

Sourceval of_int_near : int -> t
Sourceval of_int_up : int -> t
Sourceval of_int_down : int -> t
Sourceval of_int_zero : int -> t
Sourceval of_int_cur : int -> t

Conversion from int with rounding.

Sourceval of_int64_near : int64 -> t
Sourceval of_int64_up : int64 -> t
Sourceval of_int64_down : int64 -> t
Sourceval of_int64_zero : int64 -> t
Sourceval of_int64_cur : int64 -> t

Conversion from int64 with rounding.

Code from Zarith to convert from Z.t to float using the current rounding mode. We add a version for single precision rounding.

Sourceval round_z_to_single : Z.t -> bool -> t
Sourceval z_to_single : Z.t -> t
Sourceval of_z_near : Z.t -> t
Sourceval of_z_up : Z.t -> t
Sourceval of_z_down : Z.t -> t
Sourceval of_z_zero : Z.t -> t

Conversion from Zarith with rounding.

Floating-point format characteristics

Sourceval mantissa_bits : int
Sourceval exponent_bits : int
Sourceval exponent_bias : int
Sourceval min_exponent : int
Sourceval max_exponent : int
Sourceval nan_infinity_exponent : int
Sourceval min_denormal : t
Sourceval min_normal : t
Sourceval max_normal : t
Sourceval max_exact : t
Sourceval ulp : t

Units in the last place (relative precision).

Sourceval rep_of_bits : int32 -> bit_float
Sourceval bits_of_rep : bit_float -> int32
Sourceval to_bits : t -> int32
Sourceval of_bits : int32 -> t
Sourceval succ : t -> t
Sourceval pred : t -> t

Returns the float immediately follownig or preceeding the argument.

Sourceval succ_zero : t -> t
Sourceval pred_zero : t -> t

As succ and pred, but does not cross zero.

Sourceval of_string_up : string -> t
Sourceval of_string_down : string -> t

Conversion from string.

OCaml

Innovation. Community. Security.