Skip to content

otiai10/primes

Repository files navigation

primes

Go GoDoc codecov

  • Find primary numbers
% primes p 20
[2 3 5 7 11 13 17 19]
  • Factorize numbers
% primes f 329
[7 47]
  • Reduce fractions
% primes r 144/360
2/5
  • all can be executed in go code
package main

import (
	"fmt"

	"github.com/otiai10/primes"
)

func main() {
	fmt.Println(
		primes.Until(20).List(),
		primes.Factorize(144).All(),
		primes.Factorize(144).Powers(),
	)
}

// [2 3 5 7 11 13 17 19]
// [2 2 2 2 3 3]
// map[2:4 3:2]

install

go get github.com/otiai10/primes/primes

About

Find primes, factorize numbers and reduce fractions by Golang.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages