{"id":13726226,"url":"https://github.com/ocaml/Zarith","last_synced_at":"2025-05-07T21:31:48.145Z","repository":{"id":14200153,"uuid":"76130366","full_name":"ocaml/Zarith","owner":"ocaml","description":"The Zarith library implements arithmetic and logical operations over arbitrary-precision integers and rational numbers. The implementation, based on GMP, is very efficient.","archived":false,"fork":false,"pushed_at":"2024-10-14T17:03:46.000Z","size":567,"stargazers_count":230,"open_issues_count":8,"forks_count":70,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-11-05T04:51:35.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocaml.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-10T18:34:47.000Z","updated_at":"2024-11-04T23:38:40.000Z","dependencies_parsed_at":"2023-02-16T00:15:37.523Z","dependency_job_id":"2cf15edd-98e5-4107-b0ba-9c8694d9c6d2","html_url":"https://github.com/ocaml/Zarith","commit_stats":{"total_commits":251,"total_committers":38,"mean_commits":6.605263157894737,"dds":0.7888446215139442,"last_synced_commit":"a6ad837b1275c9194f998681ed068840756a2086"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocaml%2FZarith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocaml%2FZarith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocaml%2FZarith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocaml%2FZarith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocaml","download_url":"https://codeload.github.com/ocaml/Zarith/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224202880,"owners_count":17272807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T01:02:56.317Z","updated_at":"2024-11-14T16:33:32.870Z","avatar_url":"https://github.com/ocaml.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# The Zarith library\n\n## OVERVIEW\n\nThis library implements arithmetic and logical operations over\narbitrary-precision integers.\n\nThe module is simply named `Z`.  Its interface is similar to that of\nthe `Int32`, `Int64` and `Nativeint` modules from the OCaml standard\nlibrary, with some additional functions.  See the file `z.mli` for\ndocumentation.\n\nThe implementation uses GMP (the GNU Multiple Precision arithmetic\nlibrary) to compute over big integers.\nHowever, small integers are represented as unboxed Caml integers, to save\nspace and improve performance. Big integers are allocated in the Caml heap,\nbypassing GMP's memory management and achieving better GC behavior than e.g.\nthe MLGMP library.\nComputations on small integers use a special, faster path (in C or OCaml)\neschewing calls to GMP, while computations on large integers use the\nlow-level MPN functions from GMP.\n\nArbitrary-precision integers can be compared correctly using OCaml's\npolymorphic comparison operators (`=`, `\u003c`, `\u003e`, etc.).\n\nAdditional features include:\n* a module `Q` for rationals, built on top of `Z` (see `q.mli`)\n* a compatibility layer `Big_int_Z` that implements the same API as Big_int from the legacy `Num` library, but uses `Z` internally\n\nSupport for [js_of_ocaml](https://github.com/ocsigen/js_of_ocaml/) is\nprovided by [Zarith_stubs_js](https://github.com/janestreet/zarith_stubs_js).\n\n## REQUIREMENTS\n\n* OCaml, version 4.04.0 or later.\n* Either the GMP library or the MPIR library, including development files.\n* GCC or Clang or a gcc-compatible C compiler and assembler (other compilers may work).\n* The Findlib package manager (optional, recommended).\n\n\n## INSTALLATION\n\n1) First, run the \"configure\" script by typing:\n```\n   ./configure\n```\nThe `configure` script has a few options. Use the `-help` option to get a\nlist and short description of each option.\n\n2) It creates a Makefile, which can be invoked by:\n```\n   make\n```\nThis builds native and bytecode versions of the library.\n\n3) The libraries are installed by typing:\n```\n   make install\n```\nor, if you install to a system location but are not an administrator\n```\n   sudo make install\n```\nIf Findlib is detected, it is used to install files.\nOtherwise, the files are copied to a `zarith/` subdirectory of the directory\ngiven by `ocamlc -where`.\n\nThe libraries are named `zarith.cmxa` and `zarith.cma`, and the Findlib module\nis named `zarith`.\n\nCompiling and linking with the library requires passing the `-I +zarith`\noption to `ocamlc` / `ocamlopt`, or the `-package zarith` option to `ocamlfind`.\n\n4) (optional, recommended) Test programs are built and run by the additional command\n```\n  make tests\n```\n(but these are  not installed).\n\n5) (optional) HTML API documentation is built (using `ocamldoc`) by the additional command\n```\n  make doc\n```\n\n## ONLINE DOCUMENTATION\n\nThe documentation for the latest release is hosted on [GitHub Pages](https://antoinemine.github.io/Zarith/doc/latest/index.html).\n\n\n## LICENSE\n\nThis Library is distributed under the terms of the GNU Library General\nPublic License version 2, with a special exception allowing unconstrained\nstatic linking.\nSee LICENSE file for details.\n\n\n## AUTHORS\n\n* Antoine Miné, Sorbonne Université, formerly at ENS Paris.\n* Xavier Leroy, Collège de France, formerly at Inria Paris.\n* Pascal Cuoq, TrustInSoft.\n* Christophe Troestler (toplevel module)\n\n\n## COPYRIGHT\n\nCopyright (c) 2010-2011 Antoine Miné, Abstraction project.\nAbstraction is part of the LIENS (Laboratoire d'Informatique de l'ENS),\na joint laboratory by:\nCNRS (Centre national de la recherche scientifique, France),\nENS (École normale supérieure, Paris, France),\nINRIA Rocquencourt (Institut national de recherche en informatique, France).\n\n\n## CONTENTS\n\nSource files        | Description\n--------------------|-----------------------------------------\n  configure         | configuration script\n  z.ml[i]           | Z module and implementation for small integers\n  caml_z.c          | C implementation\n  big_int_z.ml[i]   | wrapper to provide a Big_int compatible API to Z\n  q.ml[i]           | rational library, pure OCaml on top of Z\n  zarith_top.ml     | toplevel module to provide pretty-printing\n  projet.mak        | builds Z, Q and the tests\n  zarith.opam       | package description for opam\n  z_mlgmpidl.ml[i]  | conversion between Zarith and MLGMPIDL\n  tests/            | simple regression tests and benchmarks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focaml%2FZarith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focaml%2FZarith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focaml%2FZarith/lists"}