0

When I enter the command:

pow(9,999999);

I obtain the following:

Bad argument 1 to pow(). Exponent too large.
Unknown program: pow(Gmp.mpz(999999))
-:1: 9->pow(@0=Gmp.mpz(999999))
HilfeInput:1: HilfeInput()->___HilfeWrapper()

Somebody would be able to indicate me how implementing the library efficaciously GMP.mpz, for example, to calculate 9 ^999999 or the factorial of 500000. In advance thank you very much for your help.

Best regards

WerthJK
  • 1
  • 1

2 Answers2

0

Was 15 years since I used pike, so this is only possible answer:

1) maybe you need pike compiled with bignum support: https://pike.lysator.liu.se/docs/man/chapter_3.html#1 and then you can use
pow() with arbitrary integers.

2) Alternatively perhaps Math module can be used.

Gnudiff
  • 4,297
  • 1
  • 24
  • 25
0

Looks like this limitation is hard-coded in Pike sources: static void mpzmod_pow(INT32 args) in src/modules/Gmp/mpz_glue.c. The sources obtainable from here: Pike sources

Yyttsa
  • 59
  • 1
  • 5
  • `pike --info` gives info about the build. My pike says, among other stuff: `Features......auto_bignum` and the problem still happens. – Yyttsa Jun 29 '18 at 20:02
  • Also `Math` module doesn't seem to be made for exponentiation. – Yyttsa Jun 29 '18 at 20:03