* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
@ 2010-04-07 9:11 ` vincent+libc at vinc17 dot org
2010-04-07 9:12 ` vincent+libc at vinc17 dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: vincent+libc at vinc17 dot org @ 2010-04-07 9:11 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From vincent+libc at vinc17 dot org 2010-04-07 09:11 -------
The code is invalid. %f takes an argument of type double, not a _Decimal64. You
need the D modifier (see WG14/N1312, 9.5 Formatted input/output specifiers), e.g.
%Df.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
2010-04-07 9:11 ` [Bug libc/11475] " vincent+libc at vinc17 dot org
@ 2010-04-07 9:12 ` vincent+libc at vinc17 dot org
2010-04-07 9:16 ` zimmerma+gcc at loria dot fr
` (6 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: vincent+libc at vinc17 dot org @ 2010-04-07 9:12 UTC (permalink / raw)
To: glibc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |vincent+libc at vinc17 dot
| |org
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
2010-04-07 9:11 ` [Bug libc/11475] " vincent+libc at vinc17 dot org
2010-04-07 9:12 ` vincent+libc at vinc17 dot org
@ 2010-04-07 9:16 ` zimmerma+gcc at loria dot fr
2010-04-07 9:17 ` vincent+libc at vinc17 dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2010-04-07 9:16 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From zimmerma+gcc at loria dot fr 2010-04-07 09:15 -------
Vincent, you are right. With printf ("%.20Df\n", e) I get:
tarte% gcc bug.c
tarte% ./a.out
0.10000000000000000555
%.20Df
which is not very useful...
Paul
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
` (2 preceding siblings ...)
2010-04-07 9:16 ` zimmerma+gcc at loria dot fr
@ 2010-04-07 9:17 ` vincent+libc at vinc17 dot org
2010-04-07 9:25 ` vincent+libc at vinc17 dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: vincent+libc at vinc17 dot org @ 2010-04-07 9:17 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From vincent+libc at vinc17 dot org 2010-04-07 09:17 -------
With a corrected code:
#include <stdio.h>
int main (void)
{
double d = 0.1;
_Decimal64 e = 0.1;
printf ("%.20f\n", d);
printf ("%Da\n", e);
printf ("%De\n", e);
printf ("%Df\n", e);
printf ("%Dg\n", e);
return 0;
}
currently gives:
0.10000000000000000555
%Da
%De
%Df
%Dg
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
` (3 preceding siblings ...)
2010-04-07 9:17 ` vincent+libc at vinc17 dot org
@ 2010-04-07 9:25 ` vincent+libc at vinc17 dot org
2010-04-07 9:38 ` schwab at linux-m68k dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: vincent+libc at vinc17 dot org @ 2010-04-07 9:25 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From vincent+libc at vinc17 dot org 2010-04-07 09:25 -------
Also, this doesn't matter now, but if accuracy needs to be taken into account
(once this is implemented), one should use
_Decimal64 e = 0.1dd;
for the tests, instead of:
_Decimal64 e = 0.1;
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
` (4 preceding siblings ...)
2010-04-07 9:25 ` vincent+libc at vinc17 dot org
@ 2010-04-07 9:38 ` schwab at linux-m68k dot org
2010-04-07 13:30 ` drepper at redhat dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: schwab at linux-m68k dot org @ 2010-04-07 9:38 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From schwab at linux-m68k dot org 2010-04-07 09:37 -------
*** Bug 11476 has been marked as a duplicate of this bug. ***
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
` (5 preceding siblings ...)
2010-04-07 9:38 ` schwab at linux-m68k dot org
@ 2010-04-07 13:30 ` drepper at redhat dot com
2010-04-07 15:30 ` vincent+libc at vinc17 dot org
2010-04-28 8:15 ` zimmerma+gcc at loria dot fr
8 siblings, 0 replies; 11+ messages in thread
From: drepper at redhat dot com @ 2010-04-07 13:30 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From drepper at redhat dot com 2010-04-07 13:30 -------
This is what the printf hooks are for. I'm not going to add any such
non-standard conversion. It far too dangerous a compability risk going forward.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
` (6 preceding siblings ...)
2010-04-07 13:30 ` drepper at redhat dot com
@ 2010-04-07 15:30 ` vincent+libc at vinc17 dot org
2010-04-28 8:15 ` zimmerma+gcc at loria dot fr
8 siblings, 0 replies; 11+ messages in thread
From: vincent+libc at vinc17 dot org @ 2010-04-07 15:30 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From vincent+libc at vinc17 dot org 2010-04-07 15:30 -------
The conversion is currently non-standard, but it may become standard in the
future. At that time, the status of this bug will have to be revised.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug libc/11475] support for printing/reading decimal numbers (_Decimal64)
2010-04-07 8:40 [Bug libc/11475] New: support for printing/reading decimal numbers (_Decimal64) zimmerma+gcc at loria dot fr
` (7 preceding siblings ...)
2010-04-07 15:30 ` vincent+libc at vinc17 dot org
@ 2010-04-28 8:15 ` zimmerma+gcc at loria dot fr
8 siblings, 0 replies; 11+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2010-04-28 8:15 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From zimmerma+gcc at loria dot fr 2010-04-28 08:15 -------
(In reply to comment #6)
> This is what the printf hooks are for. I'm not going to add any such
> non-standard conversion. It far too dangerous a compability risk going forward.
Dear Ulrich, please can you explain why this is "non-standard". With respect to
which standard? Is _Decimal64 standard?
Also, if someone provides changes to scanf/printf based on functions already
existing in libbid or libdecnumber (currently used internally by gcc) for
conversions between strings and decimal formats, would them be included in glibc?
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11475
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 11+ messages in thread