Module Percent

module Percent: sig .. end
An abstract type of scale factors

type t 
include Stringable
of_string and t_of_sexp disallow nan, inf, etc.
include Sexpable
sexps are of the form 5bp or 0.05% or 0.0005x
include Binable
include Comparable
include Comparable.With_zero

Arithmetic

include Commutative_group.S
val ( * ) : t -> t -> t
val neg : t -> t
val abs : t -> t
val is_zero : t -> bool
val is_nan : t -> bool
val is_inf : t -> bool
val apply : t -> float -> float
apply t x multiplies the percent t by x, returning a float
val scale : t -> float -> t
scale t x scales the percent t by x, returning a new t
val of_mult : float -> t
of_mult 5. is 5x = 500% = 50_000bp
val to_mult : t -> float
val of_percentage : float -> t
of_percentage 5. is 5% = 0.05x = 500bp
val to_percentage : t -> float
val of_bp : float -> t
of_bp 5. is 5bp = 0.05% = 0.0005x
val to_bp : t -> float
val of_bp_int : int -> t
val to_bp_int : t -> int
rounds down
val t_of_sexp_allow_nan_and_inf : Std_internal.Sexp.t -> t
val of_string_allow_nan_and_inf : string -> t
val validate : t -> Validate.t
module Stable: sig .. end