! Test pentru: machine-epsilon; ULP; intrinsic function EPSILON.
subroutine test_eps_16()
implicit real(16) (a-h, o-z)

real(16) machine_EPS
character(20) text(3)


machine_EPS =2.Q0**(-113)
ULP1 =2.Q0**(-112)
EPS =EPSILON(1.Q0)

print *, 'ULP(1.Q0) =2**(-112):   ', ULP1
print *, 'machine_EPS =2**(-113):', machine_EPS
print *, 'EPSILON(real(16)):     ', EPS
print *

text(1) ='1.Q0 + ULP(1.Q0)'
text(2) ='1.Q0 + machine_EPS'
text(3) ='1.Q0 + EPSILON'

u  =1.Q0+ULP1
u1 =1.Q0 +machine_EPS		! nu este >1.Q0 - fiindca se rotunjeste
u2 =1+ EPS


! write to file:
write(1,*) 'Test pentru: machine-epsilon; ULP; intrinsic function EPSILON.'
write(1,*)
write(1,*) 'ULP(1.Q0) =2**(-112):   ', ULP1
write(1,*) 'machine_EPS =2**(-113): ', machine_EPS
write(1,*) 'EPS  =EPSILON(real(16)):', EPS
write(1,*)

if(u >1.Q0) then
write(1,*) trim(text(1))//' >1.Q0'
else
write(1,*) trim(text(1))//' =1.Q0'
endif

write(1,*)
if(u1 >1.Q0) then
write(1,*) trim(text(2))//' >1.Q0'
else
write(1,*) trim(text(2))//' =1.Q0'
endif

write(1,*)
if(u2 >1.Q0) then
write(1,*) trim(text(3))//' >1.Q0'
else
write(1,*) trim(text(3))//' =1.Q0'
endif

end

!---------------------------------------
