FTN95 (32-bit, many versions up to 8.3) was giving me a result off by 1.0 when evaluating NINT(double precision expression). The numbers are such that each term in the expression, as well as the sum of the terms, is exactly representable in IEEE-64 format. I give below a cut-down reproducer program.
The error does not occur with /64, nor with FTN77 V 4.03. The value of the argument to NINT when evaluating TC1 is 8912.5000D0; in IEEE-64 expressed in hex, Z'40C1684000000000'. The incorrect result given is 8912. The correct result is 8913.
I realise that, depending on whether constant subexpressions are evaluated at compile time and those values used at run time, the results can be different, so that the value actually used may be 8912.499999999999 instead of 8912.5. However, the 32-bit debugger does not show the x87 registers, so I could not look into this aspect.
The Fortran standard defines NINT(x) as INT(x+0.5) for x > 0, so the usual 'nearest or even' rule of arithmetic does not apply.
program xttbl
implicit none
double precision ti, tr, co2, co3, r1, r2, r3
double precision e1, e2, e3, es, tc1, tc2, tc3
integer ni
data ti/77400.0d0/, co2/19100d0/, co3/77400d0/
data r1/0.1d0/, r2/0.12d0/, r3/0.22d0/
C
ni=int(ti*2d-2)
tr=ni*50d0+25d0-co3
e1=r3*tr
e2=r2*(co3-co2)
e3=r1*co2
es=e1+e2+e3+1.0d0
tc1=nint(r3*tr+r2*(co3-co2)+r1*co2+1.d0)
tc2=nint(e1+e2+e3+1.0d0)
tc3=nint(es)
write(*,10)'e1,e2,e3,es ',e1,e2,e3,es
write(*,20)'TC1 ',tc1
write(*,20)'TC2 ',tc2
write(*,20)'TC3 ',tc3
10 format(1x,A,2x,4F12.4)
20 format(1x,A,14x,F7.0)
end