Commit b5751dad authored by ulrich_y's avatar ulrich_y

Consistenly applied f9428a9

parent 63b4cc59
...@@ -398,6 +398,9 @@ CONTAINS ...@@ -398,6 +398,9 @@ CONTAINS
! ieps, which is what GiNaC does (l. 1013) ! ieps, which is what GiNaC does (l. 1013)
do j=1,size(z_flat) do j=1,size(z_flat)
znorm(j) = inum(z_flat(j)%c/y%c, z_flat(j)%i0) 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 enddo
res = G_flat(znorm,inum((1.,0.), y%i0)) res = G_flat(znorm,inum((1.,0.), y%i0))
return return
...@@ -418,6 +421,9 @@ CONTAINS ...@@ -418,6 +421,9 @@ CONTAINS
! ieps, which is what GiNaC does (l. 1013) ! ieps, which is what GiNaC does (l. 1013)
do j=1,size(z_flat) do j=1,size(z_flat)
znorm(j) = inum(z_flat(j)%c/y%c, z_flat(j)%i0) 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 enddo
res = improve_convergence(znorm) res = improve_convergence(znorm)
return return
...@@ -443,7 +449,7 @@ CONTAINS ...@@ -443,7 +449,7 @@ CONTAINS
FUNCTION G_superflat(g) result(res) FUNCTION G_superflat(g) result(res)
! simpler notation for flat evaluation ! simpler notation for flat evaluation
complex(kind=prec) :: g(:), res 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 END FUNCTION G_superflat
FUNCTION G_real(g) result(res) FUNCTION G_real(g) result(res)
...@@ -522,7 +528,7 @@ CONTAINS ...@@ -522,7 +528,7 @@ CONTAINS
FUNCTION G_FLATc(Z_FLAT,Y) FUNCTION G_FLATc(Z_FLAT,Y)
complex(kind=prec), intent(in) :: z_flat(:), y complex(kind=prec), intent(in) :: z_flat(:), y
complex(kind=prec) :: g_flatc 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 END FUNCTION
......
...@@ -18,7 +18,7 @@ MODULE ieps ...@@ -18,7 +18,7 @@ MODULE ieps
end interface abs end interface abs
interface toinum 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 end interface toinum
interface tocmplx interface tocmplx
module procedure tocmplxv, tocmplxs module procedure tocmplxv, tocmplxs
...@@ -44,6 +44,21 @@ CONTAINS ...@@ -44,6 +44,21 @@ CONTAINS
absinumv = abs(n1%c) absinumv = abs(n1%c)
END FUNCTION ABSINUMV 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) FUNCTION TOINUM_cmplx(z, s)
complex(kind=prec) :: z(:) complex(kind=prec) :: z(:)
type(inum) :: toinum_cmplx(size(z)) type(inum) :: toinum_cmplx(size(z))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment