From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E92403858D1E; Thu, 8 Sep 2022 08:17:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E92403858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662625034; bh=Z5spvZOo99MtC1mnEUWrxdQ0rL3wqwJuw7mqNwGZgCg=; h=From:To:Subject:Date:From; b=tuoKuNt3tO2HTN2CnXRvlwa0N0XlAHup8VNxzDHvlYdELAaYoja6SSxPcvEcvrP+Q VQrbVHltP9P0zp+xXPImeOvNF+yVWtRiCwo9fKtXDP4yaG7Wcm4gEPuXgdKPF0V32+ 0G1IzmCw6h7+pre+DdcD1Rm9rXXfO3NSSKeWONR4= From: "gabravier at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug math/29556] New: ecvt(999999999999.9, 3, ...) is broken Date: Thu, 08 Sep 2022 08:17:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gabravier at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29556 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 =3D ecvt(999999999999.9, 3, &decpt, &sign); printf("ecvt(999999999999.9, 3, &[%d], &[%d]) =3D '%s'\n", decpt, sign, result); } I believe the following program should output either: ecvt(999999999999.9, 3, &[13], &[0]) =3D '100' or: ecvt(999999999999.9, 3, &[12], &[0]) =3D '999' glibc instead outputs this: ecvt(999999999999.9, 3, &[13], &[0]) =3D '1000' which seems like it can't possibly be correct considering the call explicit= ly 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` --=20 You are receiving this mail because: You are on the CC list for the bug.=