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

2017-04-22 Thread Paul Eggert
Bruno Haible wrote: The algorithm for the second case also applies to the first case, but no engineer with a sane mind would apply this algorithm to the first case. Ah, that explains it! I was crazy, because I indeed thought of just that one interpretation, and applied it to both cases. Perh

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

2017-04-22 Thread Bruno Haible
Paul Eggert 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

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

2017-04-22 Thread Paul Eggert
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

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

2017-04-21 Thread Bruno Haible
Hi Gisle, > When using MSVC-2015 to build the tests/unistdio/test-ulc-*.c files, > I get ASSERT() on all the '%a' formats. E.g. in > unistdio/test-ulc-vasnprintf1.exe > and unistdio/test-ulc-printf1.h (line 195): > > char *result = >my_xasprintf ("%a %d", 3.1416015625, 33, 44, 55);

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

2017-04-21 Thread Bruno Haible
Hi Paul, > On 04/19/2017 05:13 AM, Gisle Vanem wrote: > > With "%.3a %d", I do get the expected "0x1.922p+1 33". > > So are these tests somewhat gcc-centric or what? > > Yes. It looks to me like MSVC-2015 is right and glibc is wrong, at least > in the sense of acting like standard printf. I ag

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

2017-04-20 Thread Gisle Vanem
Paul Eggert wrote: On 04/19/2017 05:13 AM, Gisle Vanem wrote: With "%.3a %d", I do get the expected "0x1.922p+1 33". So are these tests somewhat gcc-centric or what? Yes. It looks to me like MSVC-2015 is right and glibc is wrong, at least in the sense of acting like standard printf. It see

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

2017-04-19 Thread Paul Eggert
On 04/19/2017 05:13 AM, Gisle Vanem wrote: With "%.3a %d", I do get the expected "0x1.922p+1 33". So are these tests somewhat gcc-centric or what? Yes. It looks to me like MSVC-2015 is right and glibc is wrong, at least in the sense of acting like standard printf.

%a format in tests-ulc*.c

2017-04-19 Thread Gisle Vanem
When using MSVC-2015 to build the tests/unistdio/test-ulc-*.c files, I get ASSERT() on all the '%a' formats. E.g. in unistdio/test-ulc-vasnprintf1.exe and unistdio/test-ulc-printf1.h (line 195): char *result = my_xasprintf ("%a %d", 3.1416015625, 33, 44, 55); ASSERT (result != NULL