Skip to content

Commit d30211f

Browse files
authored
Merge pull request #24115 from mseri/release-euler-0.2
[new release] euler (0.2)
2 parents 1554140 + 6d66538 commit d30211f

File tree

1 file changed

+63
-0
lines changed
  • packages/euler/euler.0.2

1 file changed

+63
-0
lines changed

packages/euler/euler.0.2/opam

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
opam-version: "2.0"
2+
synopsis: "An arithmetic library for OCaml's standard integers "
3+
description: """
4+
euler is a library for doing integer arithmetic with OCaml’s standard integers (31 or 63 bits). It provides:
5+
6+
* Drop-in, overflow-detecting base arithmetic:
7+
if you are paranoid about vicious bugs sneaking in silently, this library detects overflows and signal them by throwing an exception; the module can be used as a drop-in replacement for the standard library (beware that Euler.Arith.min_int differs from Stdlib.min_int, the latter being a forbidden value). There are also a few additional functions such as integer logarithms and square roots.
8+
* More advanced arithmetic:
9+
for the weird folks (like myself) who are interested in advanced arithmetic but do not care about integers larger than 262, and thus do not want the burden of using an arbitrary-precision library (zarith of GMP), there you are. The library provides some classic functions such as
10+
the GCD,
11+
the Jacobi symbol,
12+
primality testing (fast and deterministic for all 63-bit integers!),
13+
integer factorization (implementing Lenstra’s elliptic curve factorization, which was apparently one of the best known algorithms back when I wrote that code, but obviously it is still very slow! — and I must say I understand very little about it…),
14+
a prime sieve (heavily optimized) and a factorization sieve,
15+
Euler’s totient function (slow too, of course),
16+
and so on.
17+
* Solvers for some forms of integer equations (so-called “Diophantine equations”):
18+
linear congruence systems (the Chinese remainder theorem),
19+
Pell-Fermat’s equations (the Chakravala method — preliminary code that just needs some packaging effort).
20+
* Modular arithmetic:
21+
including finding modular inverses (and pseudo-inverses). A nice functorial interface provides convenient notations and uses a private type to enforce that values are always normalized in the range 0…m−1 where m is the modulus. Example use:
22+
23+
module M = Euler.Modular.Make (struct let modulo = 42 end)
24+
let () = assert (M.( !:1 /: (!:33 +: !:4) = !:5 **:(-4) ))
25+
(* modulo 42, the inverse of (33 + 4) is equal to 5^(−4) *)
26+
"""
27+
maintainer: ["Glen Mével <glen.mevel@crans.org>"]
28+
authors: ["Glen Mével <glen.mevel@crans.org>"]
29+
license: "WTFPL"
30+
homepage: "https://github.com/gmevel/euler-lib"
31+
doc: "https://gmevel.github.io/euler-lib/index.html"
32+
bug-reports: "https://github.com/gmevel/euler-lib/issues"
33+
depends: [
34+
"dune" {>= "2.0"}
35+
"ocaml" {>= "4.07"}
36+
"stdcompat" {>= "18"}
37+
"containers" {>= "3.0"}
38+
]
39+
build: [
40+
["dune" "subst"] {dev}
41+
[
42+
"dune"
43+
"build"
44+
"-p"
45+
name
46+
"-j"
47+
jobs
48+
"@install"
49+
"@runtest" {with-test}
50+
"@doc" {with-doc}
51+
]
52+
]
53+
dev-repo: "git+https://github.com/gmevel/euler-lib.git"
54+
available: arch != "x86_32" & arch != "arm32"
55+
url {
56+
src:
57+
"https://github.com/gmevel/euler-lib/releases/download/0.2/euler-0.2.tbz"
58+
checksum: [
59+
"sha256=08374ccd4df9349dbd94f57929ea89669a9374726d7dea5914a4642adaaff333"
60+
"sha512=75b563e67dec16e821ce583d773e5ac4ebbd1ec4b50b3a3d4e8d7ffac192cc9a4f295f423f5e52666df04a51b67910d1e0df58085c2f9d0b3a6559b2f55d287a"
61+
]
62+
}
63+
x-commit-hash: "ac74d58b093bd112c8c6f7946fadbd735e97c1ab"

0 commit comments

Comments
 (0)