! Test pentru: machine-epsilon; ULP; intrinsic function EPSILON.
subroutine test_eps_4()

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


machine_EPS =2.0**(-24)
ULP1 =2.0**(-23)
EPS =EPSILON(1.0_4)

print *, 'ULP(1.0) =2**(-23):     ', ULP1
print *, 'machine_EPS =2**(-24):', machine_EPS
print *, 'EPSILON(real(4)):     ', EPS
print *

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

u  =1.0+ULP1
u1 =1.0 +machine_EPS		! nu este >1.0 - 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.0) =2**(-23):    ', ULP1
write(1,*) 'machine_EPS =2**(-24): ', machine_EPS
write(1,*) 'EPS  =EPSILON(real(4)):', EPS
write(1,*)

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

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

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

end

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