Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
GMP-Java is a general-purpose JNI wrapper to the GMP library. It's
heavily based on the wrapper written in GNU Classpath for Big
Integers (GNU Classpath uses GMP for BigInteger objects). This wrapper
does nothing more than make it easier to use GMP from Java. 

The original copyright notices have been left intact. It should be
noted that this particular work is copyright (C) 2009 didier
deshommes<dfdeshom@gmail.com> and released under the GPL 2 or later. 


Building 
--------

You'll need a recent JVM, the GMP library and its sources to build
this module. To build it, simply type `make`. When the sources finish
building, you should have a jar file called `GMP.jar` that you
can use in your Java application now. 

Using
-----
You'll need to add `GMP.jar` to you classpath. The main exposed
class is `GMP`. This library follows the same conventions as GMP for
usage for efficiency reasons. In particular, all methods return
`void` and `GMP` objects are modified IN-PLACE. In general, inputs go
first in methods. Example:

    abs(GMP input, GMP result)

Example usage  in Jython:   

>>> import GMP as G
>>> a = G("23")
>>> a
23
>>> a.add(a,a) ; a
46
>>> a.negate(a) ; a 
-23
>>> a.multiply(G("10002323"),a)
230053429

TODO
----
 * Finish writing unit tests
 * More docs
 * Performance numbers

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.