public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "newbie-02 at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-113455-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113455

            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,  

most likely 'me bad', but searched too long and need professional help.  

Short - just need a tip:   
A.) me blind, 'ties away' is available,  
in that case how to activate? or  
B.) no hope, 'ties away' is NOT available,  
in that case evtl. 'why?', and if planned for the future?  
Or doe's someone know a workaround?  

what I'd like to have:  
'= 8.000000000000001DD + 0.5E-15DD' -> 8.000000000000002E+00  
'= 8.000000000000002DD + 0.5E-15DD' -> 8.000000000000003E+00  
not by 'round up', but by 'round nearest, ties away from zero'.  

what I get instead:  
'= 8.000000000000001DD + 0.5E-15DD' -> 8.000000000000002E+00  
'= 8.000000000000002DD + 0.5E-15DD' -> 8.00000000000000**2**E+00  
the second calculation suffers from 'ties to even' rounding mode.  

'The standard' IEEE 754 requires a decimal rounding mode  
'nearest, ties away from zero' since 2008, see  
http://www.dsc.ufcg.edu.br/~cnum/modulos/Modulo2/IEEE754_2008.pdf  
there '4.3.3 Rounding attribute requirements'.  

I **am** aware that gcc / glibc don't claim full standard  
compatibility for 'decimals', but consider the rounding mode  
one of the most important advantages.  

I **am** aware that 'ties away' is in effect for 'round'  
operations. But couldn't find how to activate for the implicit  
rounding in calculations.  

I **am** aware that there are near religious fanatic discussions  
about which rounding is 'better', I don't want to start similar,  
just get qualified info. Posted here despite I know it's not a  
user support forum, think the info is relevant for others too.  

In case of relevant: Intel, Linux, gcc.

             reply	other threads:[~2024-01-17 17:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 17:41 newbie-02 at gmx dot de [this message]
2024-01-17 17:51 ` [Bug c/113455] " jsm28 at gcc dot gnu.org
2024-01-17 23:29 ` newbie-02 at gmx dot de
2024-01-18  0:20 ` jsm28 at gcc dot gnu.org
2024-01-18  6:41 ` newbie-02 at gmx dot de
2024-02-06  0:48 ` newbie-02 at gmx dot de
2024-02-07 20:28 ` jsm28 at gcc dot gnu.org
2024-02-10 13:43 ` newbie-02 at gmx dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113455-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).