Make Pari-gp Return Integer Instead of Modulo

  • Thread starter Thread starter a1call
  • Start date Start date
  • Tags Tags
    Integer
Click For Summary
SUMMARY

In Pari-gp, to return an integer instead of a Modulo, users can utilize the `lift()` function or the `centerlift()` function. For example, executing `lift(Mod(1100, 19))` yields the integer 17, while `centerlift(Mod(1100, 19))` results in -2. This method provides a straightforward solution for users seeking integer outputs similar to those from Wolfram Alpha.

PREREQUISITES
  • Familiarity with Pari-gp syntax and functions
  • Understanding of modular arithmetic concepts
  • Basic knowledge of integer operations in programming
  • Experience with mathematical software tools
NEXT STEPS
  • Explore the Pari-gp documentation on the `lift()` function
  • Research additional modular arithmetic functions in Pari-gp
  • Learn about integer representation in mathematical software
  • Investigate comparisons between Pari-gp and Wolfram Alpha for modular calculations
USEFUL FOR

Mathematicians, software developers, and researchers who utilize Pari-gp for computational number theory and modular arithmetic tasks will benefit from this discussion.

a1call
Messages
90
Reaction score
5
Is there a way to make Pari-gp return an integer rather than another Modulo?

Can
Code:
(21:49) gp > Mod(1100,19)
%11 = Mod(17, 19)
return 17?
Sort of like Wolfram Alpha:
https://www.wolframalpha.com/input/?i=Mod[1100,19]

Thanks in advance.
 
Physics news on Phys.org
I got the answer on another board from a member nicknamed axn:
Code:
? 1100%19
%1 = 17
? lift( Mod(1100, 19) )
%2 = 17
? centerlift( Mod(1100, 19) )
%3 = -2
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 20 ·
Replies
20
Views
8K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 93 ·
4
Replies
93
Views
16K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K