! Test for: signed zero; denormals; infinity; Not a Number.

real(4) :: one =1.0, zero =0.0, minus_zero =-0.0
real(4) x, xe, x1, x1e, x2, x2e

open(1, file ='special.rez', form ='formatted', status ='unknown')

write(1,*) 'Minus_Zero:'
x = -one*zero
write(1,*) '-0. =', minus_zero
write(1,*) '-1*0. =', x
write(1,*) '(-1)*0. =', (-1.)*0.

write(1,*) 'sign:', sign(1., minus_zero), sign(1., x)

write(1,*)
write(1,*) 'Infinities:'
write(1,*) '1./0 =', one/zero
write(1,*) '-1./0 =', -one/zero

write(1,*)
x =10.**40; xe =1.E40;
write(1,*) '10.**40; 1E40 :', x, xe, ' ... ! Overflow:'


write(1,*)
write(1,*) 'Not a Number:'
write(1,*) '0./0 =', zero/zero
write(1,*) '(1./0)*0 =', (one/zero)*zero
write(1,*) '(1./0) +(-1./0) =', (one/zero) +(-one/zero)


x  =1.8*10.**(-38); xe =1.8E-38
x1 =1.41*10.**(-45); x1e =1.41E-45
x2 =10.**(-46); x2e =1E-46

write(1,*)
write(1,*) 'Normalized number:'
write(1,*) '1.8*10.**(-38); 1.8E-38 :', x, xe

write(1,*)
write(1,*) 'Denormals:'
write(1,*) '1.41*10.**(-45); 1.41E-45 :', x1, x1e

write(1,*)
write(1,*) 'Underflow:'
write(1,*) '10.**(-46); 1E-46 :', x2, x2e

write(1,*)
if( isnan(sqrt(-1.)) ) then
write(1,*) 'rad(-1) = NaN'
else
x =sqrt(-1.)
write(1,*) 'rad(-1):', x
endif

END

