From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A2153858C54; Tue, 10 Oct 2023 01:50:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A2153858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696902656; bh=N/8lZK9EJ4IfgvtExyr9I+/WXH6aBtKRjlq7DGVqEf8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pOLrzF1X/Xct5aDOxRMhqpAmUOBwj/OF7B9MzNHlb2pBTH/gQo4lV5n5QTOxBWqBN GMGi49pQvDqDF6OXrMJSfZPTm1ZTXgg/K/14uJ6BI5HCsM/btSgh97D9hyUoowWffk E2I1zpdd4VLTUFemSdprp/6pP8U9lHegKv4c5Ib4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111747] Problem with large float list initialization Date: Tue, 10 Oct 2023 01:50:52 +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: 11.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: bug_status resolution 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=3D111747 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski --- 32bit floating point has the following characteristics: Sign bit: 1 bit Exponent width: 8 bits Significand precision: 24 bits (23 explicitly stored) 50000000 is 0x2faf080 which is more than 24bits in precision which means it cannot be represented exactly and when you start to add 1 to something whic= h is greater than 0xfffff0 (which is what 1.67772e+07 is), the value stays the s= ame and you start to lose precision.=