public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: other/5752: Zeros not displayed as significant figures
@ 2002-02-22 13:36 jakub
  0 siblings, 0 replies; 2+ messages in thread
From: jakub @ 2002-02-22 13:36 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, warren

Synopsis: Zeros not displayed as significant figures

State-Changed-From-To: open->closed
State-Changed-By: jakub
State-Changed-When: Fri Feb 22 13:31:54 2002
State-Changed-Why:
    This has nothing to do with gcc, printf is in libc.
    But glibc does the right thing, just read some standard
    covering printf (be it ISO C99 or Unix98).
    E.g. http://www.opengroup.org/onlinepubs/007908799/xsh/fprintf.html
    sais about %g:
    Trailing zeros are removed from the fractional portion of the result; a radix character appears only if it is followed by a digit.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5752


^ permalink raw reply	[flat|nested] 2+ messages in thread

* other/5752: Zeros not displayed as significant figures
@ 2002-02-22  9:46 warren
  0 siblings, 0 replies; 2+ messages in thread
From: warren @ 2002-02-22  9:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5752
>Category:       other
>Synopsis:       Zeros not displayed as significant figures
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          mistaken
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 22 08:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Warren du Plessis
>Release:        1.0
>Organization:
>Environment:
Linux Mandrake 8 and 8.1
Kernel 2.4.6-26mdk - but other versions of the kernel give the same results.
gcc version 2.96 (Linux-Mandrake 8.0 2.96-0.48mdk) and 3.0
>Description:
The %g output format specifier does not display zeros as significant figures.  This is not correct because a zero is generally displayed if it is accurate.  For example a value of 1 should be displayed as '1.0' to two significant figures (%.2g) because the zero is accurate, but it displays it as '1'.  The %f output format specifier does not have this problem and displays zeros as necessary (1 will display as 1.0 under %.1f).
>How-To-Repeat:
Compile the sample program and run it!
I used 'gcc -o test test.c' to compile it.
>Fix:
Don't know... I was hoping some kind soul out there would help.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.c"

LyogQSBwcm9ncmFtIHRvIHNob3cgdGhlIHByb2JsZW0gd2l0aCBzaWduaWZpY2FudCBmaWd1cmVz
CiAgIENvbXBpbGUgd2l0aDogZ2NjIC1vIGx1bXBlZCBsdW1wZWQuYwogICBWZXJzaW9uIDEuMAog
ICBXcml0dGVuIGJ5OiBXLlAuIGR1IFBsZXNzaXMKICAgICAgICAgICBvbjogMjAwMi0wMi0yMiAq
LwoKI2luY2x1ZGU8c3RkaW8uaD4KCmludCBtYWluKCkKewogIGludCBjb3VudDE7CiAgZG91Ymxl
IHZhbHVlOwoKICBmb3IgKGNvdW50MSA9IDE7IGNvdW50MSA8PSAxMDsgY291bnQxKyspCiAgICB7
CiAgICAgIHZhbHVlID0gY291bnQxOwogICAgICBwcmludGYoIiVkXHQlLjZnXHQlLjZmXG4iLCBj
b3VudDEsIHZhbHVlLCB2YWx1ZSk7CiAgICB9CgogIHJldHVybiAwOwp9Cg==


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-02-22 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-22 13:36 other/5752: Zeros not displayed as significant figures jakub
  -- strict thread matches above, loose matches on Subject: below --
2002-02-22  9:46 warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).