arithmoi: Efficient basic number-theoretic functions. Primes, powers, integer logarithms.

[ algorithms, library, math, mit, number-theory ] [ Propose Tags ]
Change log Changes
Dependencies array (>=0.3 && <0.6), base (==4.*), containers (>=0.3 && <0.6), ghc‑prim, integer‑gmp (==0.*), mtl (>=2.0 && <2.3), random (>=1.0 && <1.2) [details]
License MIT
Copyright (c) 2011 Daniel Fischer
Author Daniel Fischer
Maintainer Daniel Fischer <>
Revised Revision 2 made by AdamBergmark at Tue Mar 10 23:02:31 UTC 2015
Category Math, Algorithms, Number Theory
Home page
Bug tracker
Source repo head: hg clone
Uploaded by DanielFischer at Sun Jul 13 14:11:14 UTC 2014
Distributions LTSHaskell:, NixOS:, Stackage:, openSUSE:
Downloads 18349 total (150 in the last 30 days)
Rating 1.25 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]
Hackage Matrix CI

A library of basic functionality needed for number-theoretic calculations. The aim of this library is to provide efficient implementations of the functions. Primes and related things (totients, factorisation), powers (integer roots and tests, modular exponentiation), integer logarithms. Note: Requires GHC >= 6.12 with the integer-gmp package for efficiency. Portability is on the to-do list (with low priority, however).





Compile the library with the llvm backend


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees