diff --git a/_posts/2017-04-30-ocaml.md b/_posts/2017-04-30-ocaml.md index ed0608d..33201b6 100644 --- a/_posts/2017-04-30-ocaml.md +++ b/_posts/2017-04-30-ocaml.md @@ -1,5 +1,14 @@ --- title: OCaml -code: 0.1 +. 0.2;; -result: float = 0.300000000000000044 +code: + - 0.1 +. 0.2;; + - Q.(to_float ((of_ints 1 10) + (of_ints 2 10)));; +result: + - float = 0.300000000000000044 + - float = 0.3 --- + +OCaml has [arbitrary-precision rational number support][1] from the [Zarith library][2]. + +[1]: https://github.com/ocaml/Zarith +[2]: https://opam.ocaml.org/packages/zarith/