From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB03B3858C52; Tue, 10 Oct 2023 19:52:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB03B3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696967542; bh=EFJV3pRDS/hnd+C9NZ+Nr0NqOM7xxbrHXn0101e1fVw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uS7EfOgCzaDPoC/ROLj/xVrfv5+rizNdGCkvt8eBdJC1d3BaRBnZ9N4uH9gMS1sSy 4gPnRUb/4ggHEksqXe4Jax9jhxK7uu3HIGf59xJrgLQyRlvwp7UJB2rf7MqFcYisdP IATiZglwGhiEmJ+sN0sESnGUjz7C8ZpSu6EWostY= From: "oplata.kes1 at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111747] Problem with large float list initialization Date: Tue, 10 Oct 2023 19:52:22 +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: oplata.kes1 at mail dot ru 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: 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 --- Comment #2 from oplata.kes1 at mail dot ru --- (In reply to Andrew Pinski from comment #1) >=20 > 32bit floating point has the following characteristics: > Sign bit: 1 bit > Exponent width: 8 bits > Significand precision: 24 bits (23 explicitly stored) >=20 >=20 > 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 wh= ich > is greater than 0xfffff0 (which is what 1.67772e+07 is), the value stays = the > same and you start to lose precision. Thank you very much!=