Max Alekseyev on Wed, 29 Nov 2017 17:17:21 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Segmentation Fault in PARI library related to factoru_pow()


This is my first attempt to use factoru_pow() function and I got 

  ***   bug in PARI/GP (Segmentation Fault), please report.  ***   Error in the PARI system. End of program.

while running the following C++ code:

====
#include <iostream>
#include <pari/pari.h>
int main()
{
    pari_init(1ull<<30,1000);
    GEN F = gel( factoru_pow(4), 3 ); // prime powers
    long nf = glength(F);                      // number of prime powers
    for(long i=1; i<=nf; ++i) {
       std::cout << itos( gel(F,i) ) << std::endl;
    }
  return 0;
}
====

Is anything wrong with my code and/or PARI library?

Thanks,
Max