This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
[...]This is the standard-required behavior for DATE_AND_TIME. SECNDS is nonstandard, and the G77 manual doesn't document its behavior at midnight.
From libgfortran/intrinsics/date_and_time.c, I get
So, unless the C function 'fmod' is YAMIIOM (yet another math illiterate implementation of modulo), I don't understand how the tests can return 86400.0!
Probably we want to emulate whatever g77 did,
This is not the case: the following codelet
print *, secnds(86400.0), secnds(86401.0) end
gives
-27613. -27614.
with g77 ( -27581.053 -27582.053 with g95, slightly later!-) and
58799.91 58798.91
with gfortran, i.e., gfortran fold the result in [0.0,86400.0[ (or]?).
[...]I don't really like using magic numbers like this. How about defining
tol = 2.0 * (24.0 * 3600.0 - nearest (24.0 * 3600.0, -1.0))
at the beginning, and using that? Though, actually, there's a better phrasing of the same idea:
tol = 2.0 * spacing (24.0 * 3600.0)
Does that seem to work as well?
Just a coding style question: is F90 syntax allowed in *.f codes? or are they supposed to be compiled with a f77 compiler?
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |