| Karim Belabas on Tue, 18 Jun 2013 10:42:49 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: windows 7 |
* Ahmad Kamal [2013-06-18 10:34]:
> 2) I got a floating error when I run something like this " p^e mod n "
> given that p, e, n are 1024 bits, so I need to know If PARIGP can support
> such operations and if there are any solutions to overcome such errors
? p = random(2^1024);
? n = random(2^1024);
? e = random(2^1024);
? Mod(p, n)^e
%4 = Mod(69385032932171365295186767408126928176586897311504613591152004442415063532730061006838433460706220938904331242995850061435657050104153421907843766557177258498633974305632563760704792595960240856897851599231039103059869590474298285801967182682928066860759258987208134612874193094162521278085114388471761193950, 105063345230616104657348013634297701786006542128941909083101185888832813981927541578449103885990606406091215423988641232290414368860661235234905516208831410002395649542617648887800946357680235133745987328106517234870888931439344639465469355722657253870347038180634028206997149618094761699250765049161158009075)
The error
? (p^e) % n
*** at top-level: (p^e)%n
*** ^----
*** _^_: overflow in lg().
is expected since the integer (p^e) cannot be represented in PARI,
and in fact on any physical computer: it has about 2^1034 bits,
i.e. almost 10^300 Terabytes of data :-)
Cheers,
K.B.
--
Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1 Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation http://www.math.u-bordeaux1.fr/~kbelabas/
F-33405 Talence (France) http://pari.math.u-bordeaux1.fr/ [PARI/GP]
`