Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #162757

Re: Decimal Floating Point

Path csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.uzoreto.com!aioe.org!BFmHnFuKgZIQaiywaVRfTQ.user.46.165.242.75.POSTED!not-for-mail
From Thomas David Rivers <rivers@dignus.com>
Newsgroups comp.lang.c
Subject Re: Decimal Floating Point
Date Mon, 13 Sep 2021 22:23:47 -0400
Organization Aioe.org NNTP Server
Message-ID <614007B3.80603@dignus.com> (permalink)
References <2bff66f3-391b-4785-9c43-1f056106d6a1n@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Info gioia.aioe.org; logging-data="51624"; posting-host="BFmHnFuKgZIQaiywaVRfTQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20061027
X-Notice Filtered by postfilter v. 0.9.2
X-Accept-Language en-us, en
Xref csiph.com comp.lang.c:162757

Show key headers only | View raw


Fabian Russell wrote:

>Decimal floating point was standardized as IEEE758-2008 and new C types
>were defined: _Decimal128, _Decimal64, and _Decimal32.
>
>Gcc has many built-in functions (via libgcc) to handle decimal FP:
>
>https://gcc.gnu.org/onlinedocs/gccint/Decimal-float-library-routines.html
>
>However, what puzzles me is that C has not yet incorporated the decimal
>FP types so that the ordinary binary operators, such as "+ - * /" can operate
>directly on them.  Rather, to add two _Decimal_64 values, x, y, for example,
>one must use the function __bid_adddd3(x, y) instead of x + y.
>
>Why bother to include the new types yet now allow them to be used
>arithmetically like all other standard numeric types?
>
>  
>
Just F.Y.I. - the  BID format is suggested by Intel for their processors,
the DPD format is used by IBM in their processors (z/Arch and Power.)
The various standards allow for either... if you dig down in that library
you can also find a function named __dpd_adddd3(x,y) for using the DPD
decimal floating-point format.

We implement those types/operations in the Dignus mainframe C compilers
and take advantage of the native hardware operations (for the DPD format.)

And, you can add two _Decimal64 values with just '+' (and the other
arithmetic operations as well as some I/O operations); it's part of the 
suggested
(not yet adopted) standard.

   - Dave Rivers -


-- 
rivers@dignus.com                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

Back to comp.lang.c | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Decimal Floating Point Fabian Russell <fr314159@gmail.com> - 2021-09-10 06:35 -0700
  Re: Decimal Floating Point "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2021-09-10 08:17 -0700
    Re: Decimal Floating Point scott@slp53.sl.home (Scott Lurndal) - 2021-09-10 15:44 +0000
      Re: Decimal Floating Point James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-10 12:06 -0400
        Re: Decimal Floating Point Manfred <noname@add.invalid> - 2021-09-10 18:09 +0200
          Re: Decimal Floating Point Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2021-09-10 16:23 +0000
          Re: Decimal Floating Point James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-10 12:37 -0400
        Re: Decimal Floating Point Fabian Russell <fr314159@gmail.com> - 2021-09-10 09:38 -0700
          Re: Decimal Floating Point James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-10 12:58 -0400
        Re: Decimal Floating Point Eli the Bearded <*@eli.users.panix.com> - 2021-09-10 18:11 +0000
          Re: Decimal Floating Point Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-10 12:13 -0700
            Re: Decimal Floating Point Fabian Russell <fr314159@gmail.com> - 2021-09-10 14:52 -0700
            Re: Decimal Floating Point Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-09-11 07:09 -0700
          Re: Decimal Floating Point James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-10 23:23 -0400
        Re: Decimal Floating Point scott@slp53.sl.home (Scott Lurndal) - 2021-09-10 19:04 +0000
          Re: Decimal Floating Point James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-10 23:23 -0400
            Re: Decimal Floating Point Manfred <noname@add.invalid> - 2021-09-18 19:20 +0200
              Re: Decimal Floating Point James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-20 00:16 -0400
    Re: Decimal Floating Point Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-10 11:14 -0700
      Re: Decimal Floating Point Bart <bc@freeuk.com> - 2021-09-10 23:50 +0100
        Re: Decimal Floating Point David Brown <david.brown@hesbynett.no> - 2021-09-11 20:22 +0200
          Re: Decimal Floating Point Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-11 15:37 -0700
            Re: Decimal Floating Point David Brown <david.brown@hesbynett.no> - 2021-09-12 12:58 +0200
      Re: Decimal Floating Point Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-10 17:36 -0700
  Re: Decimal Floating Point Bonita Montero <Bonita.Montero@gmail.com> - 2021-09-10 18:04 +0200
  Re: Decimal Floating Point Bonita Montero <Bonita.Montero@gmail.com> - 2021-09-10 18:06 +0200
    Re: Decimal Floating Point Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-09-10 09:37 -0700
      Re: Decimal Floating Point Bonita Montero <Bonita.Montero@gmail.com> - 2021-09-10 20:43 +0200
    Re: Decimal Floating Point "james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu> - 2021-09-10 09:52 -0700
      Re: Decimal Floating Point Fabian Russell <fr314159@gmail.com> - 2021-09-10 10:08 -0700
        Re: Decimal Floating Point antispam@math.uni.wroc.pl - 2021-09-11 00:36 +0000
    Re: Decimal Floating Point scott@slp53.sl.home (Scott Lurndal) - 2021-09-10 19:07 +0000
      Re: Decimal Floating Point Bonita Montero <Bonita.Montero@gmail.com> - 2021-09-11 06:31 +0200
        Re: Decimal Floating Point Siri Cruise <chine.bleu@yahoo.com> - 2021-09-10 23:29 -0700
          Re: Decimal Floating Point Bonita Montero <Bonita.Montero@gmail.com> - 2021-09-11 16:31 +0200
            Re: Decimal Floating Point Barry Schwarz <schwarzb@delq.com> - 2021-09-11 10:04 -0700
            Re: Decimal Floating Point James Kuyper <jameskuyper@alumni.caltech.edu> - 2021-09-11 15:08 -0400
              Re: Decimal Floating Point Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-11 15:39 -0700
                Re: Decimal Floating Point Richard Damon <Richard@Damon-Family.org> - 2021-09-11 19:28 -0400
  Re: Decimal Floating Point Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-10 11:21 -0700
  Re: Decimal Floating Point Philipp Klaus Krause <pkk@spth.de> - 2021-09-10 23:29 +0200
  Re: Decimal Floating Point Kaz Kylheku <563-365-8930@kylheku.com> - 2021-09-11 16:59 +0000
    Re: Decimal Floating Point Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-09-11 16:05 -0700
      Re: Decimal Floating Point Kaz Kylheku <563-365-8930@kylheku.com> - 2021-09-14 16:25 +0000
  Re: Decimal Floating Point "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-09-12 13:08 -0700
  Re: Decimal Floating Point Thomas David Rivers <rivers@dignus.com> - 2021-09-13 22:23 -0400

csiph-web