bug-gnulib
[Top][All Lists]
Advanced

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

Re: %a format in tests-ulc*.c


From: Paul Eggert
Subject: Re: %a format in tests-ulc*.c
Date: Sat, 22 Apr 2017 02:28:38 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Bruno Haible wrote:
Why would you consider the expected result "0x1.922p+1" wrong?

The POSIX spec says "if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish values of type double, except that trailing zeros may be omitted". Since the spec goes to the trouble of saying that trailing zeros may be omitted when FLT_RADIX is not a power of 2, and does not go to this trouble when FLT_RADIX is a power of 2, I inferred that when FLT_RADIX is a power of 2, trailing zeros cannot be omitted.

Although your interpretation is also plausible, if it is correct then I am puzzled why the "trailing zeros may be omitted" wording is present. Is there some subtle distinction between "sufficient for an exact representation of the value" and "sufficient to distinguish values" that I am not getting?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]