module Mpfr:MPFR multi-precision floating-point numberssig..end
type 'a tt
type round =
| |
Near |
| |
Zero |
| |
Up |
| |
Down |
| |
Away |
| |
Faith |
| |
NearAway |
type m
type f
typet =m tt
set, add, ...) the first parameter of type t is an out-parameter and holds the result when the function returns. For instance, add x y z adds the values of y and z and stores the result in x.
These functions are as efficient as their C counterpart: they do not imply additional memory allocation.
Pretty printing
val print : Format.formatter -> 'a tt -> unitval print_round : Format.formatter -> round -> unitval string_of_round : round -> stringval set_default_rounding_mode : round -> unitval get_default_rounding_mode : unit -> roundval round_prec : t -> round -> int -> intval get_emin : unit -> intval get_emax : unit -> intval set_emin : int -> unitval set_emax : int -> unitval check_range : t -> int -> round -> intval clear_underflow : unit -> unitval clear_overflow : unit -> unitval clear_nanflag : unit -> unitval clear_inexflag : unit -> unitval clear_flags : unit -> unitval underflow_p : unit -> boolval overflow_p : unit -> boolval nanflag_p : unit -> boolval inexflag_p : unit -> boolval set_default_prec : int -> unitval get_default_prec : unit -> intval init : unit -> 'a ttval init2 : int -> 'a ttval get_prec : 'a tt -> intval set_prec : t -> int -> unitval set_prec_raw : t -> int -> unitval set : t -> 'a tt -> round -> intval set_si : t -> int -> round -> intval set_d : t -> float -> round -> intval set_z : t -> 'a Mpz.tt -> round -> intval set_q : t -> 'a Mpq.tt -> round -> intval _set_str : t -> string -> int -> round -> unitval set_str : t -> string -> base:int -> round -> unitval _strtofr : t -> string -> int -> round -> int * intval strtofr : t -> string -> base:int -> round -> int * int(r,i) where r is the usual
ternary result, and i is the index in the string of the first not-read
character. Thus, i=0 when no number could be read at all, and is
equal to the length of the string if everything was read.val set_f : t -> 'a Mpf.tt -> round -> intval set_si_2exp : t -> int -> int -> round -> intval set_inf : t -> int -> unitval set_nan : t -> unitval swap : t -> t -> unitval init_set : 'a tt -> round -> int * 'b ttval init_set_si : int -> round -> int * 'a ttval init_set_d : float -> round -> int * 'a ttval init_set_f : 'a Mpf.tt -> round -> int * 'b ttval init_set_z : 'a Mpz.tt -> round -> int * 'b ttval init_set_q : 'a Mpq.tt -> round -> int * 'b ttval _init_set_str : string -> int -> round -> 'a ttval init_set_str : string -> base:int -> round -> 'a ttval get_d : 'a tt -> round -> floatval get_d1 : 'a tt -> floatval get_z_exp : Mpz.t -> 'a tt -> intval get_z : Mpz.t -> 'a tt -> round -> unitval _get_str : int -> int -> 'a tt -> round -> string * intval get_str : base:int -> digits:int -> t -> round -> string * intval to_string : 'a tt -> stringval to_float : ?round:round -> 'a tt -> floatval to_mpq : 'a tt -> 'b Mpq.ttval of_string : string -> round -> 'a ttval of_float : float -> round -> 'a ttval of_int : int -> round -> 'a ttval of_frac : int -> int -> round -> 'a ttval of_mpz : 'a Mpz.tt -> round -> 'b ttval of_mpz2 : 'a Mpz.tt -> 'b Mpz.tt -> round -> 'c ttval of_mpq : 'a Mpq.tt -> round -> 'b ttval add : t -> 'a tt -> 'b tt -> round -> intval add_ui : t -> 'a tt -> int -> round -> intval add_z : t -> 'a tt -> 'a Mpz.tt -> round -> intval add_q : t -> 'a tt -> 'a Mpq.tt -> round -> intval sub : t -> 'a tt -> 'b tt -> round -> intval ui_sub : t -> int -> 'a tt -> round -> intval sub_ui : t -> 'a tt -> int -> round -> intval sub_z : t -> 'a tt -> 'a Mpz.tt -> round -> intval sub_q : t -> 'a tt -> 'a Mpq.tt -> round -> intval mul : t -> 'a tt -> 'b tt -> round -> intval mul_ui : t -> 'a tt -> int -> round -> intval mul_z : t -> 'a tt -> 'a Mpz.tt -> round -> intval mul_q : t -> 'a tt -> 'a Mpq.tt -> round -> intval mul_2ui : t -> 'a tt -> int -> round -> intval mul_2si : t -> 'a tt -> int -> round -> intval mul_2exp : t -> 'a tt -> int -> round -> intval div : t -> 'a tt -> 'b tt -> round -> intval ui_div : t -> int -> 'a tt -> round -> intval div_ui : t -> 'a tt -> int -> round -> intval div_z : t -> 'a tt -> 'a Mpz.tt -> round -> intval div_q : t -> 'a tt -> 'a Mpq.tt -> round -> intval div_2ui : t -> 'a tt -> int -> round -> intval div_2si : t -> 'a tt -> int -> round -> intval div_2exp : t -> t -> int -> round -> intval sqrt : t -> 'a tt -> round -> boolval sqrt_ui : t -> int -> round -> boolval pow_ui : t -> 'a tt -> int -> round -> boolval pow_si : t -> 'a tt -> int -> round -> boolval ui_pow_ui : t -> int -> int -> round -> boolval ui_pow : t -> int -> 'a tt -> round -> boolval pow : t -> 'a tt -> 'b tt -> round -> boolval neg : t -> 'a tt -> round -> intval abs : t -> 'a tt -> round -> intval cmp : 'a tt -> 'b tt -> intval cmp_si : 'a tt -> int -> intval cmp_si_2exp : 'a tt -> int -> int -> intval sgn : 'a tt -> intval _equal : 'a tt -> 'b tt -> int -> boolval equal : 'a tt -> 'b tt -> bits:int -> boolval nan_p : 'a tt -> boolval inf_p : 'a tt -> boolval number_p : 'a tt -> boolval reldiff : t -> 'a tt -> 'b tt -> round -> unitval log : t -> 'a tt -> round -> intval log2 : t -> 'a tt -> round -> intval log10 : t -> 'a tt -> round -> intval exp : t -> 'a tt -> round -> intval exp2 : t -> 'a tt -> round -> intval exp10 : t -> 'a tt -> round -> intval cos : 'a tt -> 'b tt -> round -> intval sin : 'a tt -> 'b tt -> round -> intval tan : 'a tt -> 'b tt -> round -> intval sec : 'a tt -> 'b tt -> round -> intval csc : 'a tt -> 'b tt -> round -> intval cot : 'a tt -> 'b tt -> round -> intval sin_cos : 'a tt -> 'b tt -> 'c tt -> round -> boolval acos : t -> 'a tt -> round -> intval asin : t -> 'a tt -> round -> intval atan : t -> 'a tt -> round -> intval atan2 : t -> 'a tt -> 'b tt -> round -> intval cosh : 'a tt -> 'b tt -> round -> intval sinh : 'a tt -> 'b tt -> round -> intval tanh : 'a tt -> 'b tt -> round -> intval sech : 'a tt -> 'b tt -> round -> intval csch : 'a tt -> 'b tt -> round -> intval coth : 'a tt -> 'b tt -> round -> intval acosh : t -> 'a tt -> round -> intval asinh : t -> 'a tt -> round -> intval atanh : t -> 'a tt -> round -> intval fac_ui : t -> int -> round -> intval log1p : t -> 'a tt -> round -> intval expm1 : t -> 'a tt -> round -> intval eint : t -> 'a tt -> round -> intval gamma : t -> 'a tt -> round -> intval lngamma : t -> 'a tt -> round -> intval zeta : t -> 'a tt -> round -> intval erf : t -> 'a tt -> round -> intval erfc : t -> 'a tt -> round -> intval j0 : t -> 'a tt -> round -> intval j1 : t -> 'a tt -> round -> intval jn : t -> int -> 'a tt -> round -> intval y0 : t -> 'a tt -> round -> intval y1 : t -> 'a tt -> round -> intval yn : t -> int -> 'a tt -> round -> intval fma : t -> 'a tt -> 'b tt -> 'c tt -> round -> intval fms : t -> 'a tt -> 'b tt -> 'c tt -> round -> intval agm : t -> 'a tt -> 'b tt -> round -> intval hypot : t -> 'a tt -> 'b tt -> round -> intval const_log2 : t -> round -> intval const_pi : t -> round -> intval const_euler : t -> round -> intval const_catalan : t -> round -> intval rint : t -> 'a tt -> round -> intval ceil : t -> 'a tt -> intval floor : t -> 'a tt -> intval round : t -> 'a tt -> intval trunc : t -> 'a tt -> intval frac : t -> 'a tt -> round -> intval modf : t -> t -> 'a tt -> round -> intval fmod : t -> 'a tt -> 'b tt -> round -> intval remainder : t -> 'a tt -> 'b tt -> round -> intval integer_p : 'a tt -> boolval nexttoward : t -> 'a tt -> unitval nextabove : t -> unitval nextbelow : t -> unitval min : t -> 'a tt -> 'b tt -> round -> intval max : t -> 'a tt -> 'b tt -> round -> intval get_exp : 'a tt -> intval set_exp : t -> int -> int