primes

package module
v0.0.0-...-b987fd4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: MIT Imports: 1 Imported by: 0

README

primes

is a list of prime numbers

GoDoc GoLint

Benchmarks

  • go test -bench=Uint16IsPrime
  • go test -bench=Sieve

References

Unit8 and Uint16 primes list was stolen from here.

The sieve.go code is a variant of this sieve.

TODO

  • Uint32
  • Unit64

License

MIT

Documentation

Overview

Is a list of prime numbers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(in <-chan int, out chan<- int, prime int)

Copy the values from channel 'in' to channel 'out', removing those divisible by 'prime'.

func Generate

func Generate(ch chan<- int)

Send the sequence 2, 3, 4, ... to channel 'ch'.

func Sieve

func Sieve(num int) bool

The prime sieve: Daisy-chain Filter processes.

func Uint16IsPrime

func Uint16IsPrime(n uint16) bool

func Uint8IsPrime

func Uint8IsPrime(n uint8) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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