This is the mail archive of the
mailing list for the GCC project.
Re: Converting floor to rint
Jan Hubicka <firstname.lastname@example.org> writes:
| > Jan Hubicka <email@example.com> writes:
| > [...]
| > | > [#2] The rint functions differ from the nearbyint functions
| > | > (188.8.131.52) only in that the rint functions may raise the
| > | ^^^
| > | Does this imply that I can implement rint as nearbyint call and never
| > | cause the exception and always use frndint instruction for it that does
| > | not trap?
| > If FE_INEXACT is on, that is incorrect.
| But why the standard don't say that rint function will raise the
Sorry for having been unclear.
"may" part refers to the fact whether the programmer might want
to run rint() under a particular floating-point control mode that
would permit rint() to raise the inexact exception.
rint() cannot unconditionally set it. If FENV_ACCESS is on and
FE_INEXACT is supported then rint() should raise the exception if
appropriate. That is my understanding.
Am I still unclear?