Lines Matching refs:mpz

75 	die "GMP::sprintf: unsupported output format for mpz: $pat2\n";
149 This class provides arbitrary precision integers. A new mpz can be
150 constructed with C<mpz>. The initial value can be an integer, float,
151 string, mpz, mpq or mpf. Floats, mpq and mpf will be automatically
155 my $a = mpz(123);
156 my $b = mpz("0xFFFF");
157 my $c = mpz(1.5); # truncated
174 corresponding GMP mpz functions,
218 is modified, if other variables are referencing the same mpz object then a
219 new copy is made of it. If the variable isn't an mpz it will be coerced to
224 $a = mpz(6);
234 can be an integer, float, string, mpz, mpq or mpf, or a pair of integers or
235 mpz's. No precision is lost when converting a float or mpf, the exact value
278 C<den> return an mpz copy of the numerator or denominator respectively. In
289 integer, float, string, mpz, mpq or mpf. The second argument specifies the
355 C<get_d_2exp> accepts any integer, string, float, mpz, mpq or mpf operands
363 integer, integer string, mpz or mpq operands a string is returned.
385 C<printf> and C<sprintf> allow formatted output of GMP types. mpz and mpq
390 use GMP::Mpz qw(mpz);
392 GMP::printf ("%d %d %s", 123, mpz(2)**128, 'foo');
408 and accept any integer, string, float, mpz, mpq or mpf. For example,
411 use GMP::Mpz qw(mpz);
412 $z = mpz(123);
447 A randstate can be seeded with an integer or mpz, using the C<seed> method.
464 Each constructs a new mpz or mpf and with a distribution per the
469 $a = mpz_urandomb($r,256); # uniform mpz, 256 bits
470 $b = mpz_urandomm($r,mpz(3)**100); # uniform mpz, 0 to 3**100-1
471 $c = mpz_rrandomb($r,1024); # special mpz, 1024 bits
482 use GMP::Mpz (mpz);
484 $p = mpz(3) ** mpq(45); # allowed, 45 is an integer
486 It's an error if a conversion to an integer or mpz would cause any
489 use GMP::Mpz (mpz);
490 $p = mpz(3) + 1.25; # not allowed
491 $p = mpz(3) + mpz(1.25); # allowed, explicit truncation
496 use GMP::Mpz (mpz);
497 print mpz(3) < 3.1; # true
500 to coercion too. An integer, float or string will change type when an mpz,
503 use GMP::Mpz (mpz);
505 $a += mpz(1234); # $a becomes an mpz
513 use GMP::Mpz (mpz);
516 $z = mpz(123);
530 GMP::Mpz will treat constants as mpz's if they're integers, or ordinary
534 print 764861287634126387126378128,"\n"; # an mpz
559 print 438249738748174928193,"\n"; # an mpz
578 mpz (or mpq or mpf), only hex or octal with 0x or 0 (for mpz and mpq, but
591 C<printf> could usefully accept %b for mpz, mpq and mpf, and perhaps %x for
595 bit unfortunate. With mpz, mpq and mpf objects there's no doubt what it
602 In usual perl object style, an mpz is a reference to an object blessed into
606 A free list of mpz and mpq values is kept to avoid repeated initializing and