From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 418B1394908B; Fri, 10 Feb 2023 17:46:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 418B1394908B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676051217; bh=lM6RDNI0ivDWXK0Q6dlRggS98zeHMH+GKNFLzHXHycI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CHMRwB/GxLnyOVsrMIiDUXnL1oXEY4KojM7BNhxGMJ5j/qbhHBdvJrEqj0gmFdqgd VaaD36wfbaKBVSqmHmE7vNp6zObzxcb/dusFXTzng2psio7Cre+lPaXd1EzaPk8lrJ O7Mr0ww8Yd0SfHuahsMNOIgsv+gszTZ6cH1yoTjc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107468] std::from_chars doesn't always round to nearest Date: Fri, 10 Feb 2023 17:46:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107468 --- Comment #6 from CVS Commits --- The releases/gcc-12 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:0061c84d2d85ca4c2ceca6116937f2d1fab6e10a commit r12-9154-g0061c84d2d85ca4c2ceca6116937f2d1fab6e10a Author: Jakub Jelinek Date: Mon Nov 7 15:17:21 2022 +0100 libstdc++: Update from latest fast_float [PR107468] The following patch partially updates from fast_float trunk. That way it gets fix for the incorrect rounding case, PR107468 aka https://github.com/fastfloat/fast_float/issues/149 Using std::fegetround showed in benchmarks too slow, so instead of doing that the patch limits the fast path where it uses floating point multiplication rather than integral to cases where we can prove there will be no rounding (the multiplication will be exact, not just that the two multiplication or division operation arguments are exactly representable). 2022-11-07 Jakub Jelinek PR libstdc++/107468 * src/c++17/fast_float/fast_float.h: Partial merge from fast_fl= oat 662497742fea7055f0e0ee27e5a7ddc382c2c38e commit. * testsuite/20_util/from_chars/pr107468.cc: New test. (cherry picked from commit cb0ceeaee9e041aaac3edd089b07b439621d0f29)=