klausler / fortran-wringer-tests

A collection of non-portable Fortran usage, standard-conformant or otherwise
40 stars 2 forks source link

Fortan extension: two adjacent arithmetic operators #5

Closed xecej4 closed 7 months ago

xecej4 commented 7 months ago

DEC/Compaq/Intel Fortran compilers allow, as an extension, the occurrence of two arithmetic operators in expression. Here is an example:

   program nonUnary
   implicit none
   integer i,j,k,m
   real x,y,z
   i = 3
   j = 2+-i*i
   k = 2+-3*-3
   m = 2+-i**2
   print *,i,j,k,m
   x = 2.0**-3
   y = 2.0**-i
   z = 1.0+-x**-3
   print *,x,y,z
   end
klausler commented 7 months ago

Added to suite as doubled-operators.f; thanks!