Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Using modular numbers with Math::Pari

by hv (Parson)
on Oct 29, 2009 at 12:40 UTC ( #803944=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      use Math::Pari qw/ PARI Mod /;
      my($n, $p) = map PARI($_), (3, 17);
      my $recip = PARI(1) / Mod($n, $p);
      print "1 / $n == $recip\n";
    
  2. or download this
      $int = int($recip);
    PARI:   ***   incorrect type in comparison. at -e line 1.
    ...
    
      $int = pari2iv($recip);
    PARI:   ***   incorrect type in gtolong. at -e line 1.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://803944]
Approved by Corion
Front-paged by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2015-07-05 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls