E Poen on Thu, 26 Dec 2019 12:00:02 +0100


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

How to write and read GEN to file in PARI?


Hi all,

I'm using PARI in C, and I have bunch of GEN objects where some are integers generated using randomi, and some are Qfb elements. Now, the point is that I want to write a few of these GEN objects to a file, and then afterwards I want to read them from a file. I want to use a single file to hold multiple GEN objects. What's the proper way to handle this in PARI?

I can basically convert them to string using GENtostr and write the strings to a file, however, later I do now know how can I read them into GEN as some are integers some Qfb, and I see that there is strtoi to read integer, but I don't know whether there exists equivalent one for Qfb. Was wondering how can one write and read arbitrary PARI objects to a file in C.

Regards,
E Poen