Skip to content

yvan-sraka/rust-bignum

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bignums for Rust backed by GMP

I'm hoping this will eventually be a drop-in replacement for the existing BigInt library, but I may change the API a bit in some places that I find awkward.

Currently only BigUint is supported, and all you can do is convert to and from, print, add, subtract, and multiply.

let x = 42.to_biguint().unwrap();
let two = 2.to_biguint().unwrap();

println!("{}", x + two); //-> 44
println!("{}", x - two); //-> 40
println!("{}", x * two); //-> 84

Installation

To build and test:

make

To install into system rustlib:

make install

To build examples:

make examples

Examples can then be run from build/examples. (Note: building examples also installs the library system-wide, which may not be desired.)

About

Bignum bindings for rust backed by GMP

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Rust 94.9%
  • Makefile 5.1%