diff --git a/src/gpl_module.f90 b/src/gpl_module.f90 index 5e4a94ac5fc2ca1df9e79ed5fb5b3742841a3224..36e5f81254294668ef27516277d2df38801b622c 100644 --- a/src/gpl_module.f90 +++ b/src/gpl_module.f90 @@ -398,6 +398,9 @@ CONTAINS ! ieps, which is what GiNaC does (l. 1013) do j=1,size(z_flat) znorm(j) = inum(z_flat(j)%c/y%c, z_flat(j)%i0) + if (abs(aimag(znorm(j)))>zero) then + znorm(j)%i0 = int(sign(1._prec, aimag(znorm(j))),1) + endif enddo res = G_flat(znorm,inum((1.,0.), y%i0)) return @@ -418,6 +421,9 @@ CONTAINS ! ieps, which is what GiNaC does (l. 1013) do j=1,size(z_flat) znorm(j) = inum(z_flat(j)%c/y%c, z_flat(j)%i0) + if (abs(aimag(znorm(j)))>zero) then + znorm(j)%i0 = int(sign(1._prec, aimag(znorm(j))),1) + endif enddo res = improve_convergence(znorm) return @@ -443,7 +449,7 @@ CONTAINS FUNCTION G_superflat(g) result(res) ! simpler notation for flat evaluation complex(kind=prec) :: g(:), res - res = G_flat(toinum(g(1:size(g)-1)), inum(g(size(g)),di0)) + res = G_flat(toinum(g(1:size(g)-1)), toinum(g(size(g)))) END FUNCTION G_superflat FUNCTION G_real(g) result(res) @@ -522,7 +528,7 @@ CONTAINS FUNCTION G_FLATc(Z_FLAT,Y) complex(kind=prec), intent(in) :: z_flat(:), y complex(kind=prec) :: g_flatc - g_flatc = G_flat(toinum(z_flat), inum(y,di0)) + g_flatc = G_flat(toinum(z_flat), toinum(y)) END FUNCTION diff --git a/src/ieps.f90 b/src/ieps.f90 index 4e22022340234783055a0d330c1ef2bcdd0ce588..a2930532a33fb2912e988fdc7fefa90fb1599a4c 100644 --- a/src/ieps.f90 +++ b/src/ieps.f90 @@ -18,7 +18,7 @@ MODULE ieps end interface abs interface toinum - module procedure toinum_cmplx, toinum_real, toinum_reals, toinum_int + module procedure toinum_cmplxs, toinum_cmplx, toinum_real, toinum_reals, toinum_int end interface toinum interface tocmplx module procedure tocmplxv, tocmplxs @@ -44,6 +44,21 @@ CONTAINS absinumv = abs(n1%c) END FUNCTION ABSINUMV + FUNCTION TOINUM_cmplxs(z, s) + complex(kind=prec) :: z + type(inum) :: toinum_cmplxs + integer(1),optional :: s + integer(1) :: ss + if (present(s)) then + ss = s + else + ss = di0 + endif + toinum_cmplxs = inum(z, ss) + if (abs(aimag(z))>zero) then + toinum_cmplxs%i0 = int(sign(1._prec, aimag(z)),1) + endif + END FUNCTION TOINUM_cmplxs FUNCTION TOINUM_cmplx(z, s) complex(kind=prec) :: z(:) type(inum) :: toinum_cmplx(size(z))