linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Will Newton <will.newton-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: ilogb manpage
Date: Fri, 31 Oct 2014 07:27:19 +0100	[thread overview]
Message-ID: <54532BC7.3000304@gmail.com> (raw)
In-Reply-To: <CANu=DmhD79gzEoXR=cSoKkQC6rzYwrP_iGD-Ljn6zf9GWFY0Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

      parent reply	other threads:[~2014-10-31  6:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54532BC7.3000304@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=will.newton-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).