/* Copyright (C) 2019 Alessandro Languasco */ /**************** A. LANGUASCO ******************** ************* COMPUTATION OF THE EULER KRONECKER CONSTANTS MOD q(PRIME) *******/ /***************** Precomputations for the external C program ****************/ \\ \p needed to decide the precision default (format, f) for the floating point {mainEK(q)= local(g, g1, minutes, millisec, seconds, elaptimeprecomp, prootfile); default(format , f); \\ print numbers with floating point notation (not E notation) if (!isprime(q) || q==2, print("****** error: q has to be an odd prime ******");return); /* initialization */ prootfile = fileopen("./primroot.res", "w"); filewrite(prootfile,q); gettime(); print("Computing the primitive root for q = ",q, " and saving on file"); g1=znprimroot(q); g=lift(g1); elaptimeprecomp=gettime(); filewrite(prootfile,g); fileclose(prootfile); /* print computation time */ seconds=floor(elaptimeprecomp/1000)%60; minutes=floor(elaptimeprecomp/60000); millisec=elaptimeprecomp- minutes*60000 - seconds*1000; \\print(elaptimeprecomp); print("Primitive root generation time: ", minutes, " min, ", seconds, " sec, ", millisec, " millisec"); print("******************************************"); print("Now you can call the precomputation programs"); print("******************************************"); } /************************************ *******/