mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-13 01:23:57 +01:00
18 lines
279 B
OCaml
18 lines
279 B
OCaml
open Core.Std
|
|
|
|
type t = float with sexp
|
|
|
|
let of_float x = x
|
|
let of_int i = Float.of_int i
|
|
let of_string s = Float.of_string s
|
|
|
|
|
|
let to_float x = x
|
|
let to_int x = Float.to_int x
|
|
let to_string x =
|
|
if x >= 0. then
|
|
Printf.sprintf "+%f" x
|
|
else
|
|
Printf.sprintf "%f" x
|
|
|