Skip to content

Commit

Permalink
Add lossy alert for of_float
Browse files Browse the repository at this point in the history
  • Loading branch information
yawaramin committed Nov 22, 2020
1 parent d1d9045 commit d9a8e78
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/decimal.mli
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ val of_int : int -> t
val of_string : ?context:Context.t -> string -> t

val of_float : ?context:Context.t -> float -> t
[@@alert lossy "Suffers from floating-point precision loss. Other constructors should be preferred."]
(** [of_float ?context float] is the decimal representation of the [float]. This
suffers from floating-point precision loss; the other constructors should be
preferred. *)
Expand Down

0 comments on commit d9a8e78

Please sign in to comment.