A bignum issue on Math function pow()
Woojin Jeon <[email protected]> Fri, 23 Apr 2021 10:18:31 +0900
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAMDnXfrtPmB_2aFeo+UJraMj3PW_jjrHCFySJ4VNS8-uZ7=K8g@mail.gmail.com> |
Hello, I'm using Pike build 8.0.1116, and came across an error around bignum I'm sure I compiled it with a bignum support, but I met following error: Pike v8.0 release 1116 running Hilfe v3.5 (Incremental Pike Frontend) > pow(5,999999); Bad argument 1 to pow(). Exponent too large. Unknown program: pow(Gmp.mpz(999999)) -:1: 5->pow(@0=Gmp.mpz(999999)) HilfeInput:1: HilfeInput()->___HilfeWrapper() I'd searched and found two: i. the example listed below, it seemed to work, but with 8.0.1116, no luck http://rosettacode.org/wiki/Arbitrary-precision_integers_(included) Pike <http://rosettacode.org/wiki/Category:Pike> > string res = (string)pow(5,pow(4,pow(3,2))); > res[..19] == "62060698786608744707"; Result: 1 > res[<19..] == "92256259918212890625"; Result: 1 > sizeof(result); Result: 183231 -> Tried this example, see > string res = (string)pow(5,pow(4,pow(3,2))); Bad argument 1 to pow(). Exponent too large. Unknown program: pow(Gmp.mpz(262144)) -:1: 5->pow(@0=Gmp.mpz(262144)) ii. a similar issue reported here https://stackoverflow.com/questions/46478975/how-can-i-implement-the-library-gmp-mpz-to-generate-big-numbers-in-pike It would be much appreciated if someone at Dev address this issue, Best regards, woody