public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/29556] New: ecvt(999999999999.9, 3, ...) is broken
@ 2022-09-08  8:17 gabravier at gmail dot com
  2022-09-08  8:18 ` [Bug math/29556] " gabravier at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gabravier at gmail dot com @ 2022-09-08  8:17 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29556

            Bug ID: 29556
           Summary: ecvt(999999999999.9, 3, ...) is broken
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int main()
{
    int decpt, sign;
    char *result = ecvt(999999999999.9, 3, &decpt, &sign);

    printf("ecvt(999999999999.9, 3, &[%d], &[%d]) = '%s'\n", decpt, sign,
result);
}

I believe the following program should output either:

ecvt(999999999999.9, 3, &[13], &[0]) = '100'

or:

ecvt(999999999999.9, 3, &[12], &[0]) = '999'

glibc instead outputs this:

ecvt(999999999999.9, 3, &[13], &[0]) = '1000'

which seems like it can't possibly be correct considering the call explicitly
asked for 3 characters to be printed.

PS: This seems to be caused by different in rounding between what `ecvt`
determines and what `fcvt` determines in the inner call to it by `ecvt`

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-09-08 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08  8:17 [Bug math/29556] New: ecvt(999999999999.9, 3, ...) is broken gabravier at gmail dot com
2022-09-08  8:18 ` [Bug math/29556] " gabravier at gmail dot com
2022-09-08  8:20 ` [Bug math/29556] ecvt rounding in edge-cases " gabravier at gmail dot com
2022-09-08  8:21 ` gabravier at gmail dot com
2022-09-08 10:04 ` schwab@linux-m68k.org
2022-09-08 12:35 ` gabravier at gmail dot com

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).