Module Without_infix.Unboxed

A variant of the above type using unboxed floats. The operations are largely the same (but we can't currently share the module type across layouts.)

(This interface is somewhat sparser than what you see above; this is mostly not a choice and more we haven't implemented everything. Feel free to add!)

type boxed := t
type t = private float
include Ppx_quickcheck_runtime.Quickcheckable.S with type t := t
val quickcheck_generator : t Base_quickcheck.Generator.t
val quickcheck_observer : t Base_quickcheck.Observer.t
val quickcheck_shrinker : t Base_quickcheck.Shrinker.t
include Typerep_lib.Typerepable.S with type t := t
val typename_of_t : t Typerep_lib.Typename.t @@ portable
val globalize : t @ local -> t
val to_string : t -> string
val sexp_of_t : t -> Core.Sexp.t
val t_of_sexp : Core.Sexp.t -> t
include Core.Bin_prot.Binable.S__local with type t := t
include Bin_prot.Binable.S_only_functions__local with type t := t
include sig ... end
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : t Bin_prot.Read.vtag_reader

This function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.

val bin_shape_t : Bin_prot.Shape.t
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_reader_t : t Bin_prot.Type_class.reader
include Ppx_hash_lib.Hashable.S_any with type t := t
val hash_fold_t : t Ppx_hash_lib.hash_fold
module Optional_syntax : sig ... end
include module type of Optional_syntax.Optional_syntax
val is_none : t -> bool
val unsafe_value : t -> Float_u.t
val typerep_of_t : t Core.Typerep.t
val none : unit -> t
val is_some : t -> bool
val some : float -> t
val unchecked_some : float -> t
val of_float_nan_as_none : float -> t
val to_float_none_as_nan : t -> float
val neg : t -> t
val zero : unit -> t
val one : unit -> t
val scale : t -> float -> t
val equal : t -> t -> bool
val div : t -> float -> t
val abs : t -> t
val of_option : float option -> t
val to_option : t -> float option
val min : t -> t -> t

The result of min will be none if either operand is.

val select : bool -> t -> t -> t
val some_if : bool -> float -> t
val const : float -> t

A workaround for the lack of unboxed float literals; strictly speaking one can use it for non constants but the name is a helpful reminder.

val box : t -> boxed

Converters for the normal PFO.

val unbox : boxed @ local -> t
val first_some : t -> t -> t

first_some x y returns x if x is not none, else returns y

val some_or : t -> default:float -> t

some_or t ~default = first_some t (unchecked_some t)

val divide_if_denominator_nonzero_else : numerator:t -> denominator:t -> else_:t -> t

Computes numerator / denominator when denominator is nonzero, otherwise returns else_. This is done without allocating or branching by using Unboxed.select.

val value : t -> default:Float_u.t -> Float_u.t
val value_exn : t -> Float_u.t
val compare : t -> t -> int

Returns false if t is none

val is_finite : t -> bool
val is_inf : t -> bool
val is_positive : t -> bool
val is_non_negative : t -> bool
val is_negative : t -> bool
val is_non_positive : t -> bool
val is_integer : t -> bool
module Infix : sig ... end
module Ieee_nan : sig ... end

See Ieee_nan of the boxed type

include module type of Infix
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (/) : t -> t -> t
val (**) : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
module O : sig ... end
module Array : sig ... end
val merge : t -> t -> f:(float -> float -> float) -> t
module Ref : sig ... end
module Stable : sig ... end