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: Converting floor to rint


Andreas Schwab <schwab@suse.de> writes:

| |> But why the standard don't say that rint function will raise the
| |> interrupt?  I would interpred may as it can behave that way or don't
| |> have to.
| 
| Yes, rint is the weaker function.

Thanks.  I didn't understand Jan's question in that way.  Thanks
for clarifying.

| The implementation of nearbyint must
| make sure that no inexact exception is raised, whereas for rint this is
| not necessary.  That means that if you have a round instruction that never
| raises the exception it can be used to implement both functions.

Yes.  Or said differently, rint() may be implemented in terms of
nearbyint() (+ raising exception where appropriate).

-- Gaby


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