This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [PATCH][4.3] Expand lround inline for x86_64/i?86 SSE math


On 10/19/06, Brooks Moses <bmoses@stanford.edu> wrote:
Toon Moene wrote:
> Richard Guenther wrote:
>>I wonder if fortran specifies round differently, as the frontend
>>explicitly converts NINT(x) = INT(x + ((x > 0) ? 0.5 : -0.5)).
>
> Yep - sorry, don't have the reference handy.

For what it's worth, since I do have the reference handy, that's
essentially a direct translation of how the Fortran 95 standard defines
the NINT intrinsic.

So, does it define how the x + 0.5 is carried out with respect to intermediate rounding before converting to INT? Literaly writing the above yields 1.0 for NINT ( 0.5 - epsilon ) assuming the hardware rounds to nearest even for the addition.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]