MODULE ulp4816

character(5) gr(2), eg(2), lt(2)

CONTAINS
real(4) function ULP4(x)
real(4) x

!P =24; Emin =-126;
if(x /=0.) then
ULP4 =2.0**(exponent(x) -24)
else
ULP4 =2.0**(-149)   ! Emin-P+1; ~ nearest(0.,+)
endif
end function ULP4

real(8) function ULP8(x)
real(8) x

!P =53; Emin =-1022;
if(x /=0.d0) then
ULP8 =2.D0**(exponent(x) -53)
else
ULP8 =2d0**(-1074)
endif
end function

real(16) function ULP16(x)
real(16) x
!P =113; Emin =-16382;

if(x /=0.q0) then
ULP16 =2.Q0**(exponent(x) -113)
else
ULP16 =2q0**(-16494)
endif

end function


END MODULE
