arithmoi-0.8.0.0: Efficient basic number-theoretic functions.

Copyright(c) 2018 Andrew Lelechenko
LicenseMIT
MaintainerAndrew Lelechenko <andrew.lelechenko@gmail.com>
StabilityProvisional
PortabilityNon-portable (GHC extensions)
Safe HaskellSafe
LanguageHaskell2010

Math.NumberTheory.Zeta

Description

Interface to work with Riemann zeta-function and Dirichlet beta-function.

Synopsis

Documentation

intertwine :: [a] -> [a] -> [a] Source #

Joins two lists element-by-element together into one, starting with the first one provided as argument.

>>> take 10 $ intertwine [0, 2 ..] [1, 3 ..]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

skipEvens :: [a] -> [a] Source #

Skips every even-indexed element from an infinite list. Do NOT use with finite lists.

>>> take 10 (skipEvens [0, 1 ..])
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]

skipOdds :: [a] -> [a] Source #

Skips every odd-indexed element from an infinite list. Do NOT use with finite lists.

>>> take 10 (skipOdds [0, 1 ..])
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]

suminf :: (Floating a, Ord a) => a -> [a] -> a Source #

Sums every element of an infinite list up to a certain precision. I.e. once an element falls below the given threshold it stops traversing the list.

>>> suminf 1e-14 (iterate (/ 10) 1)
1.1111111111111112