This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/9548: 64-bit copiling/linking: incorrect results from setf(ios::fixed) or precision(-1)
- From: axiong at ca dot ibm dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 3 Feb 2003 18:07:20 -0000
- Subject: libstdc++/9548: 64-bit copiling/linking: incorrect results from setf(ios::fixed) or precision(-1)
- Reply-to: axiong at ca dot ibm dot com
>Number: 9548
>Category: libstdc++
>Synopsis: 64-bit copiling/linking: incorrect results from setf(ios::fixed) or precision(-1)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 03 18:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Guan-Zhu (Andrew) Xiong
>Release: gcc version 3.2
>Organization:
>Environment:
Linux Version 2.4.19
SuSE SLES 8 (ppc) - Kernel 2.4.19-ul1-ppc64-SMP (31)
>Description:
=> for 64-bit g++ compiling/linking:
"cout.setf(ios::fixed); cout.precision (-1);"
does not work as expected.
=> For the given C++ code, after 64-bit g++ compiling,
if you run it then you will get output:
-----------------
Output 30.5 as: 30
The correct output should be:
-----------------
Output 30.5 as: 30.500000
=> Refenece: ISO C++ standard
The value passed to precision(int i) must be greater
than zero. If the value is negative the floating point
insertion operators will use the default value
which is 6.
>How-To-Repeat:
1) Compile the given code with "g++ 64-bit compiler"
- e.g., /opt/cross/bin/powerpc64-linux-g++ -o hello x.C
2) Run it - hello
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: