Coder Social home page Coder Social logo

gmp-java's Introduction

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 big integers from Java.

The original copyright notices have been left intact. It should be noted that this particular work is copyright (C) 2009 didier deshommes [email protected] and released under the GPL 2 or later.

Building

Make sure JAVA_HOME is set in your environment.

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. You will also need to add the generated lib directory to your java.library.path. Example:

 $ javac -cp target/*.jar Program.java
 $ java  -Djava.library.path=gmp-java/ -cp gmp-java/ Program

The main exposed class is org.dfdeshom.math.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)

An example of using this library in java can be found in example.java which can be run using make example

gmp-java's People

Contributors

dfdeshom avatar

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.