feat(CCInt): add of_float

This commit is contained in:
Fardale 2020-01-18 16:16:52 +01:00
parent 2d1ba8d925
commit 9d083df3a6
2 changed files with 9 additions and 0 deletions

View file

@ -211,6 +211,12 @@ let of_string s =
let of_string_exn = Stdlib.int_of_string let of_string_exn = Stdlib.int_of_string
let of_float = int_of_float
(*$=
1 (of_float 1.2)
*)
type output = char -> unit type output = char -> unit
(* abstract printer *) (* abstract printer *)

View file

@ -58,6 +58,9 @@ val of_string_exn : string -> t
@raise Failure in case of failure. @raise Failure in case of failure.
@since NEXT_RELEASE *) @since NEXT_RELEASE *)
val of_float : float -> t
(** @since NEXT_RELEASE *)
val pp_binary : t printer val pp_binary : t printer
(** Print as "0b00101010". (** Print as "0b00101010".
@since 0.20 *) @since 0.20 *)