From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C6AC73858CDB; Wed, 17 Jan 2024 17:41:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6AC73858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705513270; bh=5YoBSHrIELcoR7pRM117GguDIBKcNwnQ0N6mbdc4cKM=; h=From:To:Subject:Date:From; b=DkktHnH8XbU5ROrzEGSh8uCE+S2XmvgybBJY0yamvXVyiiTf1cBymsXf9t0UvMo4x nh99kSNkIks0h3Sqj+BFKRExXVh5WCS6zjlo3fT38xDwypTZWKWRQ+FXU52QE2eXeV 9X0KP8QBjdN7qEzn/nOf6IuFQ9AIGNwW0uiXZpNE= From: "newbie-02 at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/113455] New: ROUNDING: IEEE Standard: Missing decimal rounding mode 'nearest, ties away from zero' for decimalxxx datatypes. Date: Wed, 17 Jan 2024 17:41:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: newbie-02 at gmx dot de X-Bugzilla-Status: UNCONFIRMED 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: 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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113455 Bug ID: 113455 Summary: ROUNDING: IEEE Standard: Missing decimal rounding mode 'nearest, ties away from zero' for decimalxxx datatypes. Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: newbie-02 at gmx dot de Target Milestone: --- hi @all,=20=20 most likely 'me bad', but searched too long and need professional help.=20= =20 Short - just need a tip:=20=20=20 A.) me blind, 'ties away' is available,=20=20 in that case how to activate? or=20=20 B.) no hope, 'ties away' is NOT available,=20=20 in that case evtl. 'why?', and if planned for the future?=20=20 Or doe's someone know a workaround?=20=20 what I'd like to have:=20=20 '=3D 8.000000000000001DD + 0.5E-15DD' -> 8.000000000000002E+00=20=20 '=3D 8.000000000000002DD + 0.5E-15DD' -> 8.000000000000003E+00=20=20 not by 'round up', but by 'round nearest, ties away from zero'.=20=20 what I get instead:=20=20 '=3D 8.000000000000001DD + 0.5E-15DD' -> 8.000000000000002E+00=20=20 '=3D 8.000000000000002DD + 0.5E-15DD' -> 8.00000000000000**2**E+00=20=20 the second calculation suffers from 'ties to even' rounding mode.=20=20 'The standard' IEEE 754 requires a decimal rounding mode=20=20 'nearest, ties away from zero' since 2008, see=20=20 http://www.dsc.ufcg.edu.br/~cnum/modulos/Modulo2/IEEE754_2008.pdf=20=20 there '4.3.3 Rounding attribute requirements'.=20=20 I **am** aware that gcc / glibc don't claim full standard=20=20 compatibility for 'decimals', but consider the rounding mode=20=20 one of the most important advantages.=20=20 I **am** aware that 'ties away' is in effect for 'round'=20=20 operations. But couldn't find how to activate for the implicit=20=20 rounding in calculations.=20=20 I **am** aware that there are near religious fanatic discussions=20=20 about which rounding is 'better', I don't want to start similar,=20=20 just get qualified info. Posted here despite I know it's not a=20=20 user support forum, think the info is relevant for others too.=20=20 In case of relevant: Intel, Linux, gcc.=