A quick question regarding the CEILING
and FLOOR
functions in Fortran 90/95.
Based on the documentation: https://gcc.gnu.org/onlinedocs/gfortran/CEILING.html
My impression is that they take in REALs, but return INTEGERs. However, as an example, for this simple program, I get:
PROGRAM example
REAL:: X=-3.4
nintx = NINT(x)
ceilx = CEILING(X)
floorx = FLOOR(X)
WRITE(*,*) nintx, ceilx, floorx
END PROGRAM
I get -3, -3.00000 and -4.00000. But based on the documentation all return types are INTEGERs. So why are the CEILING
and FLOOR
results displayed with the decimal point and trailing zeros?