Giter Site home page Giter Site logo

hvds / math-prime-util Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danaj/math-prime-util

0.0 1.0 0.0 10.53 MB

Perl (XS) module implementing prime number utilities, including sieves

License: Other

C 27.02% Perl 66.43% Python 0.07% XS 6.43% Raku 0.05%

math-prime-util's Introduction

Math::Prime::Util version 0.73

A module for number theory in Perl.  This includes prime sieving, primality
tests, primality proofs, integer factoring, counts / bounds / approximations
for primes, nth primes, and twin primes, random prime generation,
and much more.

The default sieving and factoring are intended to be the fastest on CPAN.
Current measurements show it is faster than:
  Math::Prime::XS
  Math::Prime::FastSieve
  Math::Factor::XS
  Math::Big
  Math::Big::Factors
  Math::Factoring
  Math::Primality
  Math::Prime::TiedArray
  Crypt::Primes
  Math::ModInt::ChineseRemainder
For non-bignums, it is typically faster than Math::Pari (and doesn't
require Pari to be installed).  With Math::Prime::Util::GMP installed
it is usually faster than Math::Pari for bigints.


SYNOPSIS

  use Math::Prime::Util qw/primes/;

  # Get a big array reference of many primes
  my $aref = primes( 100_000_000 );

  # All the primes between 5k and 10k inclusive in a regular array
  my @primes = @{ primes( 5_000, 10_000 ) };

See the POD module documentation for examples and more information on all the
methods included.


INSTALLATION

To install this module type the following:

   perl Makefile.PL
   make
   make test
   make install

You will need a C compiler compatible with the compiler used to build Perl.
Since the routines are meant to be used from Perl, the data types will match
the ones used with the Perl you are installing for.  This means a 32-bit Perl
running on a 64-bit machine will result in a 32-bit library.


DEPENDENCIES

Perl 5.6.2 or later (5.8 or later is preferred).

Bytes::Random::Secure::Tiny 1.002 or later.


COPYRIGHT AND LICENCE

Copyright (C) 2011-2021 by Dana Jacobsen <[email protected]>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.