swig: January 2009 Archives

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.

About this Archive

This page is a archive of entries in the swig category from January 2009.

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

Clicky Web Analytics 42