Add CCFloat.pi

This commit is contained in:
Raphael Sousa Santos 2020-05-15 13:41:06 +02:00 committed by Simon Cruanes
parent 18222af1a3
commit 4936cb60d4
2 changed files with 6 additions and 0 deletions

View file

@ -38,6 +38,8 @@ let max_finite_value = Stdlib.max_float
let epsilon = Stdlib.epsilon_float
let pi = 0x1.921fb54442d18p+1
let is_nan x = Stdlib.(classify_float x = Stdlib.FP_nan)
let add = (+.)

View file

@ -30,6 +30,10 @@ val epsilon : t
(** [epsilon] is the smallest positive float x such that [1.0 +. x <> 1.0].
Equal to {!Stdlib.epsilon_float}. *)
val pi : t
(** [pi] is the constant pi. The ratio of a circunference to its diameter.
@since NEXT_RELEASE *)
val is_nan : t -> bool
(** [is_nan f] returns [true] if f is NaN, [false] otherwise. *)