Brereton, Ashley on Fri, 03 Feb 2023 12:49:14 +0100


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

Fortran Pari precision


Hi there, 

I was hoping to get some clarification for the precision argument used for pari variables. For the following code snippet:

***************

  use ISO_C_BINDING, only : C_PTR
  use PARI

type(C_PTR)        :: u

integer(kind=C_LONG) :: prec   = 5 


CALL pari_init(10000000_8, 2_8) 

u = Pi2n(1_8, prec) 


*****************

As far as I can tell, 'prec = 5' gives me precision to higher than quad precision. Now I'm limited to prec >=3 , and I'd like to use lower precision in some cases.

Is there a workaround to do lower precision calculations? The reason is there are some handy functions that I'd like to use that don't require high precision calculations, e.g. complementary error function with complex input.

All the best,
Ash