PROGRAM Operations

IMPLICIT NONE

DOUBLE PRECISION :: xe, xd

PRINT*, '2**3**2   = ', 2**3**2
PRINT*, '(2**3)**2 = ', (2**3)**2
PRINT*, '2**(3**2) = ', 2**(3**2)

PRINT*

PRINT*, '4/2/2     = ', 4/2/2
PRINT*, '(4/2)/2   = ', (4/2)/2
PRINT*, '4/(2/2)   = ', 4/(2/2)

PRINT*

PRINT*, '2/4/2.0   = ', 2/4/2.0
PRINT*, '(2/4)/2.0 = ', (2/4)/2.0
PRINT*, '2/(4/2.0) = ', 2/(4/2.0)

PRINT*

PRINT*, '2/4./2    = ', 2/4./2
PRINT*, '(2/4.)/2  = ', (2/4.)/2
PRINT*, '2/(4./2)  = ', 2/(4./2)

PRINT*

xe = 0.35333E0
xd = 0.35333D0
PRINT*, 'DOUBLE PRECISION :: xe, xd'
PRINT*, 'xe = 0.35333E0 --> xe = ', xe
PRINT*, 'xd = 0.35333D0 --> xd = ', xd

PRINT*

PRINT*, '(-1.)**2              = ', (-1.)**2, '[1]'
PRINT*, '(-1.)**2.             = ', (-1.)**2., '[NaN or 1]'
PRINT*, '(-1.)**2.1            = ', (-1.)**2.1, '[NaN]'
PRINT*, '(-1.)**   1000000.0   = ', (-1.)**1000000.0, '[NaN or 1]'
PRINT*, '(-1.)**   1000001.0   = ', (-1.)**1000001.0, '[NaN or -1]'
PRINT*, '(-1.)**   1000000.1   = ', (-1.)**1000000.1, '[NaN]'
PRINT*, '(-1.)**   1000001.1   = ', (-1.)**1000001.1, '[NaN]'
PRINT*, '(-1.)**  10000000.0   = ', (-1.)**10000000.0, '[NaN or 1]'
PRINT*, '(-1.)**  10000001.0   = ', (-1.)**10000001.0, '[NaN or -1]'
PRINT*, '(-1.)** 100000000.0   = ', (-1.)**100000000.0, '[NaN or 1]'
PRINT*, '(-1.)** 100000001.0   = ', (-1.)**100000001.0, '[NaN or -1]'
PRINT*, '(-1.)**  10000000.1   = ', (-1.)**10000000.1, '[NaN]'
PRINT*, '(-1.)**2147483646     = ', (-1.)**2147483646, '[1]'
PRINT*, '(-1.)**2147483647     = ', (-1.)**2147483647, '[-1]'
PRINT*, '(-1.)** 100000000.0D0 = ', (-1.)**100000000.0D0, '[NaN or 1]'
PRINT*, '(-1.)** 100000001.0D0 = ', (-1.)**100000001.0D0, '[NaN or -1]'
PRINT*, '(-1.)**  10000000.1D0 = ', (-1.)**10000000.1D0, '[NaN]'
END
