primecount-0.1.0.0: Bindings to the primecount library
Copyright2021 Preetham Gujjula
LicenseBSD-3-Clause
Maintainerlibraries@mail.preetham.io
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Prime.Count.FFI

Description

This module provides direct access to the C API of the primecount library. It's recommended that you use the higher-level interface in Math.NumberTheory.Prime.Count.

Documentation adapted from the C API reference and primecount.h.

Synopsis

Documentation

primecount_pi :: Int64 -> Int64 Source #

Count the number of primes <= x.

primecount_pi_str :: CString -> CString -> CSize -> IO Int Source #

Count the number of primes <= x (supports 128-bit).

primecount_nth_prime :: Int64 -> Int64 Source #

Find the nth prime e.g.: primecount_nth_prime 25 == 97.

primecount_phi :: Int64 -> Int64 -> Int64 Source #

primecount_phi x a counts the numbers <= x that are not divisible by any of the first a primes.

primecount_get_max_x :: CString Source #

primecount_get_max_x is the largest number supported by primecount_pi_str.

  • 64-bit CPUs: 10^31
  • 32-bit CPUs: 2^63 - 1

primecount_get_num_threads :: IO Int Source #

Get the currently set number of threads used by libprimecount.

primecount_set_num_threads :: Int -> IO () Source #

Set the number of threads used by libprimecount.

primecount_version :: CString Source #

Get the libprimecount version number, in the form "i.j".