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


Groups > comp.lang.c > #112054 > unrolled thread

Hexadecimal float constants

Started bySteve Keller <keller@no.invalid>
First post2017-06-12 18:34 +0200
Last post2017-06-13 12:13 -0400
Articles 2 on this page of 42 — 13 participants

Back to article view | Back to comp.lang.c


Contents

  Hexadecimal float constants Steve Keller <keller@no.invalid> - 2017-06-12 18:34 +0200
    Re: Hexadecimal float constants "James R. Kuyper" <jameskuyper@verizon.net> - 2017-06-12 12:44 -0400
      Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-12 10:54 -0700
        Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-12 11:26 -0700
          Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-12 19:38 +0100
            Re: Hexadecimal float constants scott@slp53.sl.home (Scott Lurndal) - 2017-06-12 18:45 +0000
            Re: Hexadecimal float constants Robert Wessel <robertwessel2@yahoo.com> - 2017-06-12 13:54 -0500
              Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-12 20:40 +0100
                Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-12 13:06 -0700
          Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-12 13:37 -0700
            Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-12 22:22 +0100
            Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-12 16:01 -0700
              Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-12 16:36 -0700
        Re: Hexadecimal float constants jameskuyper@verizon.net - 2017-06-12 12:39 -0700
    Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-12 18:42 +0100
    Re: Hexadecimal float constants Thomas David Rivers <rivers@dignus.com> - 2017-06-12 17:27 -0400
      Re: Hexadecimal float constants "James R. Kuyper" <jameskuyper@verizon.net> - 2017-06-12 18:03 -0400
        Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-12 23:31 +0100
          Re: Hexadecimal float constants Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-13 00:10 +0100
            Re: Hexadecimal float constants jacobnavia <jacob@jacob.remcomp.fr> - 2017-06-13 01:33 +0200
              Re: Hexadecimal float constants Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-13 01:10 +0100
        Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-12 16:01 -0700
          Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-12 17:00 -0700
            Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-13 07:51 -0700
              Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-13 09:17 -0700
                Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-13 17:45 +0100
                  Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-13 11:58 -0700
                    Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-13 12:57 -0700
                      Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-13 13:01 -0700
                    Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-13 22:11 +0100
                      Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-13 14:22 -0700
                        Re: Hexadecimal float constants "James R. Kuyper" <jameskuyper@verizon.net> - 2017-06-13 17:43 -0400
                          Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-13 14:48 -0700
                        Re: Hexadecimal float constants bartc <bc@freeuk.com> - 2017-06-13 23:03 +0100
                          Re: Hexadecimal float constants GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-14 01:30 +0200
                Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-13 12:24 -0700
                  Re: Hexadecimal float constants jacobnavia <jacob@jacob.remcomp.fr> - 2017-06-13 21:52 +0200
                  Re: Hexadecimal float constants Keith Thompson <kst-u@mib.org> - 2017-06-13 13:12 -0700
                    Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-13 16:18 -0700
                  Re: Hexadecimal float constants Ike Naar <ike@iceland.freeshell.org> - 2017-06-14 21:28 +0000
      Re: Hexadecimal float constants supercat@casperkitty.com - 2017-06-12 15:21 -0700
      Re: Hexadecimal float constants Thomas David Rivers <rivers@dignus.com> - 2017-06-13 12:13 -0400

Page 3 of 3 — ← Prev page 1 2 [3]


#112093

Fromsupercat@casperkitty.com
Date2017-06-12 15:21 -0700
Message-ID<134a2a4f-7eb9-4054-916b-f4c694c1d7cb@googlegroups.com>
In reply to#112089
On Monday, June 12, 2017 at 4:26:41 PM UTC-5, Thomas David Rivers wrote:
> >I read in the thread "High quality resources for learning modern C?"
> >that 0x1234e-1 is an illegal preprocessing token, and in fact, gcc and
> >clang refuse it:
> >
> >    xf.c:3:9: error: invalid suffix "-1" on integer constant
> >     int x = 0x1234e-1;
> >
> >  
> >
> 
> Are we sure those compilers are correct?
> 
> Why isn't this the same as this declaration:
> 
>   int x =  0x1234e -  1 ;
> 
> (with extra spaces to denote the C constants/expression I see there.)
> 
> In looking at the standard - I don't see the error the compilers are 
> reporting.
> That looks like a bug in the compilers?

The authors of the C Standard define the concept of a "preprocessing number"
which is supposed to treat exponential-format numbers as a single token,
and did so in a way that treats *any* sequence containing a digit 0-9, zero
or more characters from the set [0-9A-Za-z], an E or e, a plus sign, and
more characters from the set [0-9A-za-z], as a single token.  The claimed
motivation for doing so is to make things easier for compilers, even though
many compilers that preceded the Standard used parsing strategies that made
it easier to treat 0x1E + 4 as three tokens than to treat it as one.  There
is nothing in the rationale that suggests that the authors would regard a
compiler that couldn't accept 0x1E+4 in that fashion would be in any way
more useful than one that could, but it has become fashionable for compilers
to go out of their way to reject such expressions.

[toc] | [prev] | [next] | [standalone]


#112109

FromThomas David Rivers <rivers@dignus.com>
Date2017-06-13 12:13 -0400
Message-ID<59400F21.1040908@dignus.com>
In reply to#112089
Thomas David Rivers wrote:

>
>>
>
> Are we sure those compilers are correct?
>
>
Duh - I'm not sure what I was thinking when I wrote that...

Nevermind :-)

   - Dave Rivers -


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

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.c


csiph-web