primey

package
v0.41.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheResize added in v0.41.0

func CacheResize(l int)

CacheResize sets the length of primeCache to l and fills it with primes

func FindPrimes added in v0.41.0

func FindPrimes(limit uint) []int32

FindPrimes finds and returns all primes <= limit

func Index

func Index(p int) int

Index returns the index of the prime, or if p is not prime then the index below the next highest prime

func Iter

func Iter() func(func(int, int) bool)

Iter returns an iterator over all primes

func Iterr

func Iterr(start, end int) func(func(int, int) bool)

Iterr returns an iterator over a range of index values

func Len

func Len() int

Len returns the length of the list of primes

func Nth added in v0.31.0

func Nth(n int) int

Nth returns the value of the nth prime

func Pi

func Pi(n int) int

Pi returns the number of primes up to and including n

func Prime

func Prime(p int) bool

Prime returns true if p is a prime

func PrimeMax added in v0.31.0

func PrimeMax() int

PrimeMax returns the largest prime in the list of primes

func PrimeSlow added in v0.41.0

func PrimeSlow(n int) bool

PrimeSlow returns whether a number is prime or not, used for primes > PrimeMax()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL