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] |
On Thu, Oct 19, 2006 at 03:34:23PM -0700, Steve Kargl wrote:It states that NINT(X) = INT(X+0.5) for X > 0. You then
find INT(A) = 0 for |A| < 1. A quick scan over the section
on numeric binary operators did not reveal the normal weasel words, but I suspect that the result of X+0.5 is a
processor-dependent approximation and round-to-nearest
meets that criterium.
OTOH, I think it is a bug because we can choose a better algorithm to determine if x+0.5 is truly less than 1. See for example round[f] in intrinsics/c99_functions.c
Upon further review, the standard says NINT(X) = INT(X+0.5)
for X > 0. So, if and when someone makes a change to the
inlining of NINT(X), its result needs to agree with
INT(X+0.5).
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |