package zarith-ppx

Not available on OCaml 5.5
  1. Overview
  2. Docs
Literals for Zarith's arbitrary-precision integers and rationals

Install

dune-project
 Dependency

Authors

Maintainers

Sources

zarith-ppx-0.1.tbz
sha256=5268b89f7807467fda79802d11792d8be451d54b945be005a99e35cf2e893ffe
md5=4c6c8224397b9c94a0d37120f4977576

Description

The Zarith library implements arithmetic and logical operations over arbitrary-precision integers. Zarith-ppx add support for literals of the form '13z' and '1.5q'.

Tags

ppx zarith

Added to opam-repository:

README

Zarith-ppx build status

The zarith-ppx package provides literals for arbitrary-precision integers and rationals with the Zarith library. Here are some examples:

# 1z ;;
- : Z.t = 1
# 1.234e40z ;;
- : Z.t = 12340000000000000000000000000000000000000
# 0x18z ;; (* Hexadecimal *)
- : Z.t = 24
# 1.2q ;;
- : Q.t = 6/5
# 2.45e10q ;;
- : Q.t = 24500000000
# 2.45e-5q ;;
- : Q.t = 49/2000000
# -0O123q ;; (* Octal *)
- : Q.t = -83

It also raises errors for incorrect literals:

# 1.234e2z ;;
Characters 0-8:
Error: This literal does not fit in an integer. You should use a rational number.

This package depends on vanilla Zarith, but the generated code is compatible with any cross-compiled version of Zarith such as zarith-freestanding and zarith-xen.

Dependencies (4)

  1. zarith
  2. ocaml-migrate-parsetree < "2.0.0"
  3. dune >= "1.8"
  4. ocaml >= "4.03.0"

Dev Dependencies (1)

  1. mdx with-test

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building zarith-ppx with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.1 (this version) good n/a n/a n/a n/a
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure