package kappa-library

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

Module Kappa_data_structures.NbrSource

Kappa numbers (either float, int or int64) and operations on them

Sourcetype t =
  1. | F of float
  2. | I of int
  3. | I64 of Int64.t
Sourceval compare : t -> t -> int
Sourceval is_greater : t -> t -> bool
Sourceval is_smaller : t -> t -> bool
Sourceval is_equal : t -> t -> bool
Sourceval add : t -> t -> t
Sourceval sub : t -> t -> t
Sourceval mult : t -> t -> t
Sourceval internal_div : t -> t -> t

euler division when only int are involved, float div else

Sourceval rem : t -> t -> t
Sourceval pow : t -> t -> t
Sourceval min : t -> t -> t
Sourceval max : t -> t -> t
Sourceval succ : t -> t
Sourceval pred : t -> t
Sourceval neg : t -> t
Sourceval to_float : t -> float option

None when infinity or Not a Number

Sourceval to_int : t -> int
Sourceval zero : t
Sourceval is_zero : t -> bool
Sourceval one : t
Sourceval is_strictly_positive : t -> bool
Sourceval print : Format.formatter -> t -> unit
Sourceval pretty_print : Format.formatter -> t -> unit

Floats are compactly printed

Sourceval print_option : Format.formatter -> t -> unit

Prints nothing in case of infinity or Not a Number

Sourceval iteri : (t -> 'a -> 'a) -> 'a -> t -> 'a

iteri f x n

  • returns

    f (n - k) (... (f (n - 1) (f n x))) where k < n <= k+1

Sourceval maybe_iteri : (t -> 'a -> 'a option) -> 'a -> t -> 'a

maybe_iteri f x n

  • returns

    f (n - k) (... (f (n - 1) (f n x))) up to k < n <= k+1 or f returns None

Sourceval to_string : t -> string
Sourceval of_string : string -> t
Sourceval to_yojson : t -> Yojson.Basic.t
Sourceval of_yojson : Yojson.Basic.t -> t
Sourceval write_t : Buffer.t -> t -> unit

Output a JSON value of type t.

Sourceval string_of_t : ?len:int -> t -> string

Serialize a value of type t into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type t.

Sourceval t_of_string : string -> t

Deserialize JSON data of type t.

Sourceval of_un_alg_op : Operator.un_alg_op -> t -> t
Sourceval of_bin_alg_op : Operator.bin_alg_op -> t -> t -> t
Sourceval of_compare_op : Operator.compare_op -> t -> t -> bool
OCaml

Innovation. Community. Security.