Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Features

  • Full support of 5.1.2 API (except low-level functions)

Example code

  local gmp = require 'gmp' ('libgmp-10')

  local mpz = gmp.types.z

  local a,b = mpz(), mpz()

  gmp.z_init_set_str(a, '39679054966380032223487239670184', 10)
  gmp.z_init_set_str(b, '85186439059104575627262464195387', 10)

  gmp.z_mul(a,a,b)

  gmp.printf('Result: %Zd\n', a)

  gmp.z_clears(a,b)

Differences from the C API

Binding is so close to the original API as possible, but some things still differ.

  1. Names lost 'gmp' prefix as not needed.
  2. f_get_d_2exp, f_get_str return exp as second result.
  3. Added luasprintf, for formatted output in lua string.

TODO

  • Wrap mpz_import and mpz_export functions

About

Binding for GNU MP v5.1.2

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.