Math::GMPzMath::GMPz is a Perl interface to the GMP library's integer (mpz) functions. | |
Download |
Math::GMPz Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Math::GMPz team
- Publisher web site:
- http://search.cpan.org/~sisyphus/Math-GMPz-0.21/GMPz.pm
Math::GMPz Tags
Math::GMPz Description
Math::GMPz is a Perl interface to the GMP library's integer (mpz) functions. Math::GMPz is a Perl interface to the GMP library's integer (mpz) functions.A bignum module utilising the Gnu MP (GMP) library. Basically this module simply wraps nearly all of the integer functions provided by that library. The documentation below extensively plagiarises the documentation at http://swox.com/gmp/manual.See the Math::GMPz test suite for examples of usage.SYNOPSIS use Math::GMPz qw(:mpz :primes :supp); my $string = 'fa9eeeeeeeeeeeeea1234dcbaef1'; my $base = 16; # Create the Math::GMPz object my $bn1 = Rmpz_init_set_str($string, $base); # Create another Math::GMPz object that holds # an initial value of zero, but has enough # memory allocated to store a 131-bit number. # If 131 bits turns out to be insufficient, it # doesn't matter - additional memory is allocated # automatically to Math::GMPz objects as needed # by the GMP library. my $bn2 = Rmpz_init2(131); # Create another Math::GMPz object initialised to 0. my $bn3 = Rmpz_init(); # or use the new() function: my $bn4 = Math::GMPz->new(12345); # Perform some operations ... see 'FUNCTIONS' below. . . # print out the value held by $bn1 (in octal): print Rmpz_get_str($bn1, 8), "n"; # print out the value held by $bn1 (in decimal): print Rmpz_get_str($bn1, 10); # print out the value held by $bn1 (in base 29) # using the (alternative) Rmpz_out_str() # function. (This function doesn't print a newline.) Rmpz_out_str($bn1, 29); Requirements: · Perl
Math::GMPz Related Software