mathprimes 0.1.1
Some utilities related to prime numbers
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
A primenumber library for D
This module implements an infiniteprimes range, and not much else.
gmpd is efficient and fast but can't be used at compiletime.
bench/results.org has some simple benchmarks.
usage
Add it as a dub dependency and consult the documentation. Here's a script that prints the first 50 primes:
#! /usr/bin/env dub
/+ dub.sdl:
dependency "mathprimes" version="~>0.1.0"
+/
void main() {
import math.primes: Sieve, nthPrimeUpperBound;
import std.stdio: writeln;
import std.range: take;
foreach (p; Sieve!int(nthPrimeUpperBound(50)).take(50))
writeln(p);
}
 0.1.1 released 5 years ago
 jrfondren/mathprimes
 MIT
 Copyright © 2019, Julian Fondren
 Authors:
 Dependencies:
 none
 Versions:

0.1.1 2019Dec06 0.1.0 2019Nov24 ~master 2019Dec06  Download Stats:


0 downloads today

0 downloads this week

0 downloads this month

17 downloads total

 Score:
 0.5
 Short URL:
 mathprimes.dub.pm