Re: frexp man page: FLT_RADIX vs. 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux