Math::GMP::SWIG - Perl Interface to GMP with SWIG

| | Comments (1) | TrackBacks (0)
I have started to hack on Math::GMP::SWIG, as a first step in trying to re-implement things with GMP that most Crypt::* modules use Math::Pari (the Perl interface to Pari) to accomplish. Mostly they have to do with testing primality, factoring integers and doing basic arithmetic operations as well as floor, sqrt and log on Big Numbers. You can grab the git repo with

git clone http://leto.net/code/Math-GMP-SWIG.git

The first thing I have implemented is nextprime, which returns the next prime larger than a given $x. This breaks the dependence of Crypt::Primes on Math::Pari's nextprime function. The reason that many people have voiced concerns over Perl continuing to use Math::Pari is that Math::Pari is extremely sensitive to new versions of Perl. Basically, a new version of Math::Pari must be made for almost every new version of Perl because it depends on XS internals that occasionally change. Math::Pari is written in XS, so it is a challenge to maintain.

A SWIG interface to Pari could be possible but I am more familiar with GMP and so I decided in that direction. I wrote some code in 2001 that calculated Pi with Ramunjan's famous formulas using GMP.  One algorithm gets 8 digits of precision per iteration and the other 14 digits per iteration.

I am preparing a TPF Grant proposal for this, so if any one has comments or suggestions, please comment or email me personally.

0 TrackBacks

Listed below are links to blogs that reference this entry: Math::GMP::SWIG - Perl Interface to GMP with SWIG.

TrackBack URL for this entry: http://leto.net/mt/mt-tb.cgi/132

1 Comments

OpenID commenting is enabled and working!

About this Entry

This page contains a single entry by Jonathan Leto published on January 4, 2009 2:47 PM.

Rakudo has hash slices was the previous entry in this blog.

Perl Monger Parallelism is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Clicky Web Analytics 42