Browser plug-in exposes 226 GMP functions to JavaScript

John Tobey jtobey at
Fri Apr 20 22:11:24 CEST 2012

JavaScript bindings for GMP in Firefox, Chrome, etc.

This directory contains source code for a browser plug-in that gives
scripts access to GMP, the GNU multiple precision arithmetic library.
The code status is alpha to early beta.

The plugin supports most GMP functions.  For a list, see
gmp-entries.h.  The code uses NPAPI, so the plugin should run in all
major browsers *except* Internet Explorer.  I have tested it (briefly)
in Firefox 11.0 and Chrome 19.0.1084.30.

The plugin can crash on certain input, such as requesting the square
root of a negative number.  This is hard to fix.

The per-call time overhead is quite high, unless you configure your
browser to run the plug-in in-process.  But if you do, the plug-in can
crash the browser.

This is free software and comes with NO WARRANTY as explained in

You will need:

    * GNU/Linux or a similar operating system, or some porting
    * npapi.h and accompanying files:
    * the GMP development package:
    * a C compiler:
    * Make:

To install, run the following commands.  If successful, restart your
browser and open the example page, gmp-example.html.  The example
simply pops up an alert containing the result of a calculation.

    mkdir -p ~/.mozilla/plugins/
    cp ~/.mozilla/plugins/

Errors?  Questions?  Ideas?  Email me: John.Tobey at

More information about the gmp-discuss mailing list