OCaml library : Float

`sig
val zero : float
val one : float
val minus_one : float
external neg : float -> float = "%negfloat"
external add : float -> float -> float = "%addfloat"
external sub : float -> float -> float = "%subfloat"
external mul : float -> float -> float = "%mulfloat"
external div : float -> float -> float = "%divfloat"
external fma : float -> float -> float -> float = "caml_fma_float"
"caml_fma" [@@unboxed] [@@noalloc]
external rem : float -> float -> float = "caml_fmod_float" "fmod"
[@@unboxed] [@@noalloc]
val succ : float -> float
val pred : float -> float
external abs : float -> float = "%absfloat"
val infinity : float
val neg_infinity : float
val nan : float
val signaling_nan : float
val quiet_nan : float
val pi : float
val max_float : float
val min_float : float
val epsilon : float
val is_finite : float -> bool
val is_infinite : float -> bool
val is_nan : float -> bool
val is_integer : float -> bool
external of_int : int -> float = "%floatofint"
external to_int : float -> int = "%intoffloat"
external of_string : string -> float = "caml_float_of_string"
val of_string_opt : string -> float option
val to_string : float -> string
type fpclass =
Stdlib.fpclass =
FP_normal
| FP_subnormal
| FP_zero
| FP_infinite
| FP_nan
external classify_float : (float [@unboxed]) -> Float.fpclass
= "caml_classify_float" "caml_classify_float_unboxed" [@@noalloc]
external pow : float -> float -> float = "caml_power_float" "pow"
[@@unboxed] [@@noalloc]
external sqrt : float -> float = "caml_sqrt_float" "sqrt" [@@unboxed]
[@@noalloc]
external cbrt : float -> float = "caml_cbrt_float" "caml_cbrt" [@@unboxed]
[@@noalloc]
external exp : float -> float = "caml_exp_float" "exp" [@@unboxed]
[@@noalloc]
external exp2 : float -> float = "caml_exp2_float" "caml_exp2" [@@unboxed]
[@@noalloc]
external log : float -> float = "caml_log_float" "log" [@@unboxed]
[@@noalloc]
external log10 : float -> float = "caml_log10_float" "log10" [@@unboxed]
[@@noalloc]
external log2 : float -> float = "caml_log2_float" "caml_log2" [@@unboxed]
[@@noalloc]
external expm1 : float -> float = "caml_expm1_float" "caml_expm1"
[@@unboxed] [@@noalloc]
external log1p : float -> float = "caml_log1p_float" "caml_log1p"
[@@unboxed] [@@noalloc]
external cos : float -> float = "caml_cos_float" "cos" [@@unboxed]
[@@noalloc]
external sin : float -> float = "caml_sin_float" "sin" [@@unboxed]
[@@noalloc]
external tan : float -> float = "caml_tan_float" "tan" [@@unboxed]
[@@noalloc]
external acos : float -> float = "caml_acos_float" "acos" [@@unboxed]
[@@noalloc]
external asin : float -> float = "caml_asin_float" "asin" [@@unboxed]
[@@noalloc]
external atan : float -> float = "caml_atan_float" "atan" [@@unboxed]
[@@noalloc]
external atan2 : float -> float -> float = "caml_atan2_float" "atan2"
[@@unboxed] [@@noalloc]
external hypot : float -> float -> float = "caml_hypot_float" "caml_hypot"
[@@unboxed] [@@noalloc]
external cosh : float -> float = "caml_cosh_float" "cosh" [@@unboxed]
[@@noalloc]
external sinh : float -> float = "caml_sinh_float" "sinh" [@@unboxed]
[@@noalloc]
external tanh : float -> float = "caml_tanh_float" "tanh" [@@unboxed]
[@@noalloc]
external acosh : float -> float = "caml_acosh_float" "caml_acosh"
[@@unboxed] [@@noalloc]
external asinh : float -> float = "caml_asinh_float" "caml_asinh"
[@@unboxed] [@@noalloc]
external atanh : float -> float = "caml_atanh_float" "caml_atanh"
[@@unboxed] [@@noalloc]
external erf : float -> float = "caml_erf_float" "caml_erf" [@@unboxed]
[@@noalloc]
external erfc : float -> float = "caml_erfc_float" "caml_erfc" [@@unboxed]
[@@noalloc]
external trunc : float -> float = "caml_trunc_float" "caml_trunc"
[@@unboxed] [@@noalloc]
external round : float -> float = "caml_round_float" "caml_round"
[@@unboxed] [@@noalloc]
external ceil : float -> float = "caml_ceil_float" "ceil" [@@unboxed]
[@@noalloc]
external floor : float -> float = "caml_floor_float" "floor" [@@unboxed]
[@@noalloc]
external next_after : float -> float -> float = "caml_nextafter_float"
"caml_nextafter" [@@unboxed] [@@noalloc]
external copy_sign : float -> float -> float = "caml_copysign_float"
"caml_copysign" [@@unboxed] [@@noalloc]
external sign_bit : (float [@unboxed]) -> bool = "caml_signbit_float"
"caml_signbit" [@@noalloc]
external frexp : float -> float * int = "caml_frexp_float"
external ldexp :
(float [@unboxed]) -> (int [@untagged]) -> (float [@unboxed])
= "caml_ldexp_float" "caml_ldexp_float_unboxed" [@@noalloc]
external modf : float -> float * float = "caml_modf_float"
type t = float
val compare : Float.t -> Float.t -> int
val equal : Float.t -> Float.t -> bool
val min : Float.t -> Float.t -> Float.t
val max : float -> float -> float
val min_max : float -> float -> float * float
val min_num : Float.t -> Float.t -> Float.t
val max_num : Float.t -> Float.t -> Float.t
val min_max_num : float -> float -> float * float
val seeded_hash : int -> Float.t -> int
val hash : Float.t -> int
module Array :
sig
type t = floatarray
val length : Float.Array.t -> int
val get : Float.Array.t -> int -> float
val set : Float.Array.t -> int -> float -> unit
val make : int -> float -> Float.Array.t
val create : int -> Float.Array.t
val init : int -> (int -> float) -> Float.Array.t
val make_matrix : int -> int -> float -> Float.Array.t array
val init_matrix :
int -> int -> (int -> int -> float) -> Float.Array.t array
val append : Float.Array.t -> Float.Array.t -> Float.Array.t
val concat : Float.Array.t list -> Float.Array.t
val sub : Float.Array.t -> int -> int -> Float.Array.t
val copy : Float.Array.t -> Float.Array.t
val fill : Float.Array.t -> int -> int -> float -> unit
val blit : Float.Array.t -> int -> Float.Array.t -> int -> int -> unit
val to_list : Float.Array.t -> float list
val of_list : float list -> Float.Array.t
val equal :
(float -> float -> bool) -> Float.Array.t -> Float.Array.t -> bool
val compare :
(float -> float -> int) -> Float.Array.t -> Float.Array.t -> int
val iter : (float -> unit) -> Float.Array.t -> unit
val iteri : (int -> float -> unit) -> Float.Array.t -> unit
val map : (float -> float) -> Float.Array.t -> Float.Array.t
val map_inplace : (float -> float) -> Float.Array.t -> unit
val mapi : (int -> float -> float) -> Float.Array.t -> Float.Array.t
val mapi_inplace : (int -> float -> float) -> Float.Array.t -> unit
val fold_left :
('acc -> float -> 'acc) -> 'acc -> Float.Array.t -> 'acc
val fold_right :
(float -> 'acc -> 'acc) -> Float.Array.t -> 'acc -> 'acc
val iter2 :
(float -> float -> unit) -> Float.Array.t -> Float.Array.t -> unit
val map2 :
(float -> float -> float) ->
Float.Array.t -> Float.Array.t -> Float.Array.t
val for_all : (float -> bool) -> Float.Array.t -> bool
val exists : (float -> bool) -> Float.Array.t -> bool
val mem : float -> Float.Array.t -> bool
val mem_ieee : float -> Float.Array.t -> bool
val find_opt : (float -> bool) -> Float.Array.t -> float option
val find_index : (float -> bool) -> Float.Array.t -> int option
val find_map : (float -> 'a option) -> Float.Array.t -> 'a option
val find_mapi :
(int -> float -> 'a option) -> Float.Array.t -> 'a option
val sort : (float -> float -> int) -> Float.Array.t -> unit
val stable_sort : (float -> float -> int) -> Float.Array.t -> unit
val fast_sort : (float -> float -> int) -> Float.Array.t -> unit
val shuffle : rand:(int -> int) -> Float.Array.t -> unit
val to_seq : Float.Array.t -> float Stdlib.Seq.t
val to_seqi : Float.Array.t -> (int * float) Stdlib.Seq.t
val of_seq : float Stdlib.Seq.t -> Float.Array.t
val map_to_array : (float -> 'a) -> Float.Array.t -> 'a array
val map_from_array : ('a -> float) -> 'a array -> Float.Array.t
external unsafe_get : Float.Array.t -> int -> float
= "%floatarray_unsafe_get"
external unsafe_set : Float.Array.t -> int -> float -> unit
= "%floatarray_unsafe_set"
end
module ArrayLabels :
sig
type t = floatarray
val length : Float.ArrayLabels.t -> int
val get : Float.ArrayLabels.t -> int -> float
val set : Float.ArrayLabels.t -> int -> float -> unit
val make : int -> float -> Float.ArrayLabels.t
val create : int -> Float.ArrayLabels.t
val init : int -> f:(int -> float) -> Float.ArrayLabels.t
val make_matrix :
dimx:int -> dimy:int -> float -> Float.ArrayLabels.t array
val init_matrix :
dimx:int ->
dimy:int -> f:(int -> int -> float) -> Float.ArrayLabels.t array
val append :
Float.ArrayLabels.t -> Float.ArrayLabels.t -> Float.ArrayLabels.t
val concat : Float.ArrayLabels.t list -> Float.ArrayLabels.t
val sub :
Float.ArrayLabels.t -> pos:int -> len:int -> Float.ArrayLabels.t
val copy : Float.ArrayLabels.t -> Float.ArrayLabels.t
val fill : Float.ArrayLabels.t -> pos:int -> len:int -> float -> unit
val blit :
src:Float.ArrayLabels.t ->
src_pos:int ->
dst:Float.ArrayLabels.t -> dst_pos:int -> len:int -> unit
val to_list : Float.ArrayLabels.t -> float list
val of_list : float list -> Float.ArrayLabels.t
val equal :
eq:(float -> float -> bool) ->
Float.ArrayLabels.t -> Float.ArrayLabels.t -> bool
val compare :
cmp:(float -> float -> int) ->
Float.ArrayLabels.t -> Float.ArrayLabels.t -> int
val iter : f:(float -> unit) -> Float.ArrayLabels.t -> unit
val iteri : f:(int -> float -> unit) -> Float.ArrayLabels.t -> unit
val map :
f:(float -> float) -> Float.ArrayLabels.t -> Float.ArrayLabels.t
val map_inplace : f:(float -> float) -> Float.ArrayLabels.t -> unit
val mapi :
f:(int -> float -> float) ->
Float.ArrayLabels.t -> Float.ArrayLabels.t
val mapi_inplace :
f:(int -> float -> float) -> Float.ArrayLabels.t -> unit
val fold_left :
f:('acc -> float -> 'acc) -> init:'acc -> Float.ArrayLabels.t -> 'acc
val fold_right :
f:(float -> 'acc -> 'acc) -> Float.ArrayLabels.t -> init:'acc -> 'acc
val iter2 :
f:(float -> float -> unit) ->
Float.ArrayLabels.t -> Float.ArrayLabels.t -> unit
val map2 :
f:(float -> float -> float) ->
Float.ArrayLabels.t -> Float.ArrayLabels.t -> Float.ArrayLabels.t
val for_all : f:(float -> bool) -> Float.ArrayLabels.t -> bool
val exists : f:(float -> bool) -> Float.ArrayLabels.t -> bool
val mem : float -> set:Float.ArrayLabels.t -> bool
val mem_ieee : float -> set:Float.ArrayLabels.t -> bool
val find_opt : f:(float -> bool) -> Float.ArrayLabels.t -> float option
val find_index : f:(float -> bool) -> Float.ArrayLabels.t -> int option
val find_map :
f:(float -> 'a option) -> Float.ArrayLabels.t -> 'a option
val find_mapi :
f:(int -> float -> 'a option) -> Float.ArrayLabels.t -> 'a option
val sort : cmp:(float -> float -> int) -> Float.ArrayLabels.t -> unit
val stable_sort :
cmp:(float -> float -> int) -> Float.ArrayLabels.t -> unit
val fast_sort :
cmp:(float -> float -> int) -> Float.ArrayLabels.t -> unit
val shuffle : rand:(int -> int) -> Float.ArrayLabels.t -> unit
val to_seq : Float.ArrayLabels.t -> float Stdlib.Seq.t
val to_seqi : Float.ArrayLabels.t -> (int * float) Stdlib.Seq.t
val of_seq : float Stdlib.Seq.t -> Float.ArrayLabels.t
val map_to_array : f:(float -> 'a) -> Float.ArrayLabels.t -> 'a array
val map_from_array : f:('a -> float) -> 'a array -> Float.ArrayLabels.t
external unsafe_get : Float.ArrayLabels.t -> int -> float
= "%floatarray_unsafe_get"
external unsafe_set : Float.ArrayLabels.t -> int -> float -> unit
= "%floatarray_unsafe_set"
end
end`