linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ilogb manpage
@ 2014-10-29 12:18 Will Newton
       [not found] ` <CANu=DmhD79gzEoXR=cSoKkQC6rzYwrP_iGD-Ljn6zf9GWFY0Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Will Newton @ 2014-10-29 12:18 UTC (permalink / raw)
  To: Michael Kerrisk-manpages; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hi,

The ilogb manpage currently claims that errno is not set on error:

       Domain error: x is 0 or a NaN
              An invalid floating-point exception (FE_INVALID) is raised.

              These functions do not set errno for this case.

       Domain error: x is an infinity

              These functions do not set errno or raise an exception
for this case.

However this is at odds with the ISO C standard an the most recent glibc code:

int
__ilogb (double x)
{
  int r = __ieee754_ilogb (x);
  if (__builtin_expect (r == FP_ILOGB0, 0)
      || __builtin_expect (r == FP_ILOGBNAN, 0)
      || __builtin_expect (r == INT_MAX, 0))
    {
      __set_errno (EDOM);
      feraiseexcept (FE_INVALID);
    }
  return r;
}


-- 
Will Newton
Toolchain Working Group, Linaro
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-10-31  6:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 12:18 ilogb manpage Will Newton
     [not found] ` <CANu=DmhD79gzEoXR=cSoKkQC6rzYwrP_iGD-Ljn6zf9GWFY0Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-31  6:27   ` Michael Kerrisk (man-pages)

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 NNTP newsgroup(s).