public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* isnan and exceptions
@ 2020-08-28 15:23 Florian Weimer
  2020-09-01 20:31 ` Adhemerval Zanella
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2020-08-28 15:23 UTC (permalink / raw)
  To: libc-help

It seems that __builtin_isnanl raises Invalid Operation for sNaNs on
x86-64, but glibc's isnanl implementation does not.

Is this expected?  Are both behaviors correct?

The background of my question is that if I replace isnanl with this:

int
isnanl (long double x)
{
  return __builtin_isnanl (x);
}

I get these test suite failures:

testing long double (without inline functions)
Failure: isnan (sNaN): Exception "Invalid operation" set
Failure: isnan (-sNaN): Exception "Invalid operation" set
Failure: isnan_downward (sNaN): Exception "Invalid operation" set
Failure: isnan_downward (-sNaN): Exception "Invalid operation" set
Failure: isnan_towardzero (sNaN): Exception "Invalid operation" set
Failure: isnan_towardzero (-sNaN): Exception "Invalid operation" set
Failure: isnan_upward (sNaN): Exception "Invalid operation" set
Failure: isnan_upward (-sNaN): Exception "Invalid operation" set

Thanks,
Florian


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-01 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28 15:23 isnan and exceptions Florian Weimer
2020-09-01 20:31 ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).