PROGRAM exceptions

IMPLICIT NONE

REAL :: a = 1.e24, b=1.e-24, c=0.0, d=-2.0

PRINT *,'overflow ',a*a
PRINT *,'underflow ',b*b
PRINT *,'divide by zero ',d/c
PRINT *,'log(0) ',LOG(c)
PRINT *,'-2*log(0) ',d*LOG(c)
PRINT *,'sqrt(neg) ', SQRT(d)
PRINT *,'log(a*a) ',LOG(a*a)
PRINT *,'2log(a) ',2.*LOG(a)
PRINT *,'exp(2*log(a))', EXP(2.*LOG(a))
PRINT *,'operation on underflow ',SQRT(b*b)
PRINT *,'operation on overflow ',SQRT(a*a)

END PROGRAM exceptions
