You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/07/02 21:11:05 UTC
[jira] Commented: (STDCXX-463) [HP-UX 11.23] printf("%Lg", -NAN)
formatted incorrectly
[ https://issues.apache.org/jira/browse/STDCXX-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509642 ]
Martin Sebor commented on STDCXX-463:
-------------------------------------
Response from HP:
-------- Original Message --------
Subject: Re: HP-UX 11.23 printf("%Lg", -NAN) formatted incorrectly
Date: Thu, 28 Jun 2007 20:14:30 -0700 (PDT)
From: Dennis Handly <dh...@cup.hp.com>
To: acxx@cup.hp.com, sebor@roguewave.com
>From: Martin Sebor <se...@roguewave.com>
>On 11.23/PA, printf("%g") formats negative NaN correctly (by
>prepending the minus) but with "%Lg" it forgets the sign.
>On 11.31/IPF printf() works correctly.
-std::numeric_limits<long double>::quiet_NaN()
This works correctly on all IPF versions. Because the IPF libc has
_U_Qfneg and PA doesn't. The PA compiler uses _U_Qfsub which doesn't
produce negative NaNs.
>Are there plans to backport the fix to prior versions of HP-UX and/or PA?
Martin
I seriously doubt it. libc would have to change and then all of the
compilers.
There were other CRs about negating NaNs:
JAGaa73927 NaN signs not respected
JAGaa86217 Incorrect printing of long double NaNs
JAGaa91576 Signed NaNs aren't generated correctly (see JAGaa78419 for C equiv)
JAGaa78419 NaN signs not respected (2)
JAGad01217 incorrect display of -nan from printf in libc
> [HP-UX 11.23] printf("%Lg", -NAN) formatted incorrectly
> -------------------------------------------------------
>
> Key: STDCXX-463
> URL: https://issues.apache.org/jira/browse/STDCXX-463
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Environment: HP-UX 11.23 and prior
> Reporter: Martin Sebor
>
> -------- Original Message --------
> Subject: HP-UX 11.23 printf("%Lg", -NAN) formatted incorrectly
> Date: Thu, 28 Jun 2007 19:34:32 -0600
> From: Martin Sebor <se...@roguewave.com>
> Organization: Rogue Wave Software
> To: acxx@cup.hp.com
> Hi,
> On 11.23/PA, printf("%g") formats negative NaN correctly (by
> prepending the minus) but with "%Lg" it forgets the sign. On
> 11.31/IPF printf() works correctly. Are there plans to backport
> the fix to prior versions of HP-UX and/or PA?
> Thanks
> Martin
> $ cat t.cpp && aCC -AA t.cpp && ./a.out
> #include <assert.h>
> #include <stdio.h>
> #include <string.h>
> #include <limits>
> int main ()
> {
> char nan [32];
> char nnan [32];
> char lnan [32];
> char nlnan [32];
> sprintf (nan, "%g", std::numeric_limits<double>::quiet_NaN ());
> sprintf (nnan, "%g", -std::numeric_limits<double>::quiet_NaN ());
> sprintf (lnan, "%Lg", std::numeric_limits<long double>::quiet_NaN ());
> sprintf (nlnan, "%Lg", -std::numeric_limits<long double>::quiet_NaN ());
> printf ("%s, %s\n%s, %s\n", nan, nnan, lnan, nlnan);
> assert (0 == strcmp (nan, lnan));
> assert (0 == strcmp (nnan, nlnan));
> }
> nan, -nan
> nan, nan
> Assertion failed: 0 == strcmp (nnan, nlnan), file t.cpp, line 21
> ABORT instruction (core dumped)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.