* 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[parent not found: <CANu=DmhD79gzEoXR=cSoKkQC6rzYwrP_iGD-Ljn6zf9GWFY0Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: ilogb manpage [not found] ` <CANu=DmhD79gzEoXR=cSoKkQC6rzYwrP_iGD-Ljn6zf9GWFY0Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-10-31 6:27 ` Michael Kerrisk (man-pages) 0 siblings, 0 replies; 2+ messages in thread From: Michael Kerrisk (man-pages) @ 2014-10-31 6:27 UTC (permalink / raw) To: Will Newton Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA Hi Will, On 10/29/2014 01:18 PM, Will Newton wrote: > 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; > } Thanks for the report. Things were fixed in glibc 2.16 ( https://www.sourceware.org/bugzilla/show_bug.cgi?id=6794 ) and I've now updated the man page. Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- 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).