From: Alejandro Colomar <alx@kernel.org>
To: Morten Welinder <mwelinder@gmail.com>
Cc: linux-man@vger.kernel.org
Subject: Re: frexp man page: FLT_RADIX vs. 2
Date: Wed, 3 Jan 2024 02:49:32 +0100 [thread overview]
Message-ID: <ZZS9LDDna5lnjA_K@debian> (raw)
In-Reply-To: <CANv4PNkqQBPn_oyfdYZfOck-7gGwzP6YPPA9hDaiaJPUj+c3xw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 984 bytes --]
Hello Morten,
On Tue, Jan 02, 2024 at 08:29:08PM -0500, Morten Welinder wrote:
> A very minor bug:
>
> The main body of frexp's man page says the exponent returned is for a
> power of two. That agrees with, for example, the C99 standard as well
> as https://en.cppreference.com/w/cpp/numeric/math/frexp
>
> However, the sample program in the man page uses FLT_RADIX. The value
> of that macro need not be 2 so the man page should be changed to use 2
> directly.
The value of that macro is defined to be 2; it can't have any other
value.
ISO C defines it in
<http://port70.net/~nsz/c/c11/n1570.html#5.2.4.2.2p11>.
POSIX defines it in
<https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/float.h.html>.
Maybe the definition of frexp() by ISO C and POSIX should be changed to
define it in terms of FLT_RADIX instead of 2.
Have a lovely day,
Alex
--
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-01-03 1:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 1:29 frexp man page: FLT_RADIX vs. 2 Morten Welinder
2024-01-03 1:49 ` Alejandro Colomar [this message]
2024-01-03 3:50 ` Matthew House
2024-01-03 3:57 ` Alejandro Colomar
2024-01-29 12:29 ` Alejandro Colomar
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=ZZS9LDDna5lnjA_K@debian \
--to=alx@kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=mwelinder@gmail.com \
/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