module Value:Creation and conversion of numerical quantities.sig..end
type t
exception Invalid_conversion of t * SIunits.Unit.d
SIunits.Value.scale_to and SIunits.Value.convert when a value
cannot be converted into the given units.exception Invalid_units of t * t * string
SIunits.Value.(+:), SIunits.Value.(-:) and SIunits.Value.(<-:) when two
values cannot be combined due to incompatible units. The string argument
identifies which function/operator raised the exception.val value : float -> SIunits.Unit.t -> tval (%<) : float -> SIunits.Unit.t -> tval units_of : t -> SIunits.Unit.tval (=.) : float -> float -> bool
The algorithm is described in these articles by
Alberto Squassabia
and
Bruce Dawson
(older version
here).
val (=!.) : float -> float -> boolSIunits.Value.(=.)).val float_eq : ?rel:float -> ?abs:float -> unit -> float -> float -> boolrel : The relative error tolerance (default = 10-15).abs : The absolute error tolerance (default = 10-200).val eq : t -> t -> boolval (=:) : t -> t -> boolval eq_units : t -> t -> boolval (=?:) : t -> t -> boolval assign : t Pervasives.ref -> t -> unitInvalid_units (v1, v2, "assign") if the units of the two values
(v1 and v2) are not compatible.val (<-:) : t Pervasives.ref -> t -> unitInvalid_units (v1, v2, "<-:") if the units of the two values
(v1 and v2) are not compatible.val get : t Pervasives.ref -> floatval (!:) : t Pervasives.ref -> floatval scale_to : t -> SIunits.Unit.t -> floatInvalid_conversion (v, d) if the value v and units d are not
compatible.val (%>) : t -> SIunits.Unit.t -> floatInvalid_conversion (v, d) if the value v and units d are not
compatible.val convert : value:float -> from:SIunits.Unit.t -> into:SIunits.Unit.t -> floatscale_to (create value from) into or
value %< from %>into.Invalid_conversion (v, d) if the numerical value and source units
v are not compatible with the destination units d.val (+:) : t -> t -> tInvalid_units (v1, v2, "+:") if the units of the two values
(v1 and v2) are not compatible.val (-:) : t -> t -> tInvalid_units (v1, v2, "-:") if the units of the two values
(v1 and v2) are not compatible.val ( *: ) : t -> t -> tval (/:) : t -> t -> tval ( *:. ) : t -> float -> tval (/:.) : t -> float -> tval (/.:) : float -> t -> t