Thanks for generating the output. There was a collection of files unfortunately lost that was accumulated as bugs were encountered (often when switching platforms or during development)
that frequently started off with a little code that you were asked to produce the answers for by hand before reading the manuscript. In an attempt to re-create it (if memory serves me right it was more complicated and had the equivalents of 0.0-epsilon(0.0) and 0+epsilon(0.0) in it somewhere) it went something like this for signed zeros:
! gfortran -fsign-zero
! gfortran -no-fsign-zero
! ifort -assume minus0
! ifort -noassume minus0
character(len=*),parameter :: g='(*(g0,1x))'
write(*,g)'float:'
a=-0.0
b=0.0
! my favorite: compare -0.0 to 0.0 and take sqrt of negative 0
if(a==0.0)write(*,*)'sqrt(a)=',sqrt(a)
write(*,g)a.eq.b
write(*,g)a.lt.b
write(*,g)a.gt.b
write(*,'(b32.32)')a,b
write(*,g)'a,b=',a,b
write(*,g)'sign(0.0,-0.0)=',sign(0.0,-0.0)
write(*,g)'sign(1.0,-0.0)=',sign(1.0,-0.0)
write(*,g)'anint([-0.0,0.0,-0.1,-0.5,0.5])=',anint([-0.0,0.0,-0.1,-0.5,0.5])
write(*,g)'nint([-0.0,0.0,-0.1,-0.5,0.5])=',nint([-0.0,0.0,-0.1,-0.5,0.5])
write(*,g)'integer:'
a=-0.1
write(*,g)'a=',a,'nint(a)=',nint(a),'int(a-0.5)=',int(a-0.5)
i=-0
j=0
write(*,'(b32.32)')i,j
write(*,g)i,j
write(*,g)'sign(0,-0)=',sign(0,-0)
write(*,g)'sign(1,-0)=',sign(1,-0)
end
it was probably F77-compatible, though. There was a change in what SIGN(-0.0) produced starting with f90 (I think); but roughly the idea was to decide what the output would be first, and
then try it. It would be a long journey down memory lane, but the output would vary in the past a lot more than it is likely to do now. Some of them were great reads; but alas they are lost to the sands of time.
Note in the comments you can see the switches for gfortran as well as ifort; two common compilers.
I know one “banned” practice discussed was using -0.0 as a flag for missing values, which caused a bug during transitioning to a new platform but I do not remember all the details ; except I always try to avoid depending on signed zeros since reading it. Maybe just an old habit I could drop(?); but it was not that long ago someone was asking what the junk at the start of a program was trying to do. It had a few lines similar to the above and if the result was not -1 it printed out something like “: $CODE depends on support of negative zero float values during convergence. Read SIGNZ in DUSTY repository”; and I knew what it meant. They added “-assume minus0” on the compile and all was well with the world.
PS: I remember a little more about the one bug. REAL values were read from a file and -1.0 represented missing measurements. A new platform did everything OK with the tests, but some runs with actual user data was getting incorrect results. Some of the user files were using -0 instead of -0.0 for the missing values; which previous values read as -1.0 but the new platform was returning 0.0 when the (list-directed) reads encountered “-0”. It was totally missed by the QA process where all the values representing missing measurements had decimal places.