package euler
An arithmetic library for OCaml's standard integers
Install
Dune Dependency
Authors
Maintainers
Sources
euler-0.1.tbz
sha256=46786c629673fc8f36c6ee57764778188983f6de8e24d3003a8de21e4752919c
sha512=5273d89967cba8397139a179c243ecb7a80c008961a06bc5396316cc32651fc902a9eb0152b98f5075db4331349d6c8dc23f249ca3fc67be5b984daac9debd6c
doc/euler/Euler/index.html
Module Euler
Source
This is a library for arithmetic algorithms, primarily developed to solve Project Euler problems, although it is of more general use.
Toplevel values
Commonly useful functions not related to arithmetic.
Generic fast exponentiation. pow ~mult ~unit x n
is unit
composed n
times to the right with x
, provided that n
is non‐negative. For example:
pow ~mult:(^) ~unit:"x" "y" 5
yields "xyyyyy"
. Complexity: 𝒪(log(n
)) calls to mult
.
Memoizing fixpoint combinator. Example use:
let fib = memoized_fix@@fun fib n ->
if n < 2 then
1
else
fib (n-1) + fib (n-2)
Modules on OCaml integers
Solving diophantine equations, i.e. equations on integers.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page