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


Groups > comp.lang.c > #71477

Re: Spurious diagnostic messages

From Bartc <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: Spurious diagnostic messages
Date 2015-09-30 13:56 +0100
Organization A noiseless patient Spider
Message-ID <mugm22$e48$1@dont-email.me> (permalink)
References (8 earlier) <kfnpp2cy38e.fsf@x-alumni2.alumni.caltech.edu> <d41c4gFmnsqU1@mid.individual.net> <kfnh9mhgrzn.fsf@x-alumni2.alumni.caltech.edu> <lnk2rc95f3.fsf@kst-u.example.com> <mucerd$reg$1@speranza.aioe.org>

Show all headers | View raw


On 28/09/2015 23:26, glen herrmannsfeldt wrote:
> Keith Thompson <kst-u@mib.org> wrote:
>
> (snip)
>> You assert that binary constants don't provide a capability that
>> is fairly easily available othrwise.  I disagree.
>
>> The capability they provide is expressing bit patterns clearly.
>
>> It could be argued that hexadecimal constants provide the same
>> capabiility.  If I see `0x56`, it's obvious to me at a glance that
>> the bit pattern is `0b0101_0110` (I'll temporarily assume that we
>> have underscores in constants as well).  If I see `0xcd`, it takes
>> me a moment to figure out that the bit pattern is `0b1100_1101`.
>> That's just me, but I'm sure I'm not the only one.
>
> As long as they are appropriately aligned, I can usually read them
> fairly easily. (Not so long ago, I was doing microcode dumps reading
> the lights in binary, and writing down hex digits. It takes me just
> a little longer to distinguish X'B' and X'D'.)
>
> By properly aligned, I mean that I can't do shifts that aren't
> multiples of four in my head.  Reading a hex dump of IEEE floating
> point values, and then putting the bits together before and after
> the binary point, I have to write them down, then read back the
> bits as new hex digits.

This is it: binary is necessary going to be used in convenient 4-bit 
groups tidily aligned on 4-bit boundaries.

If looking for a non-aligned bit-pattern of ...01110... for example, 
that's always going to be easier with binary than hex or octal.

-- 
Bartc

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


Thread

Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-26 07:44 -0700
  Re: Spurious diagnostic messages Keith Thompson <kst-u@mib.org> - 2015-09-26 15:33 -0700
    Re: Spurious diagnostic messages Gareth Owen <gwowen@gmail.com> - 2015-09-28 19:57 +0100
      Re: Spurious diagnostic messages Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-28 20:52 +0100
      Re: Spurious diagnostic messages Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-09-29 11:19 +0000
    Re: Spurious diagnostic messages glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-09-28 22:26 +0000
      Re: Spurious diagnostic messages Bartc <bc@freeuk.com> - 2015-09-30 13:56 +0100
        Re: Spurious diagnostic messages Gareth Owen <gwowen@gmail.com> - 2015-09-30 19:22 +0100
          Re: Spurious diagnostic messages Bartc <bc@freeuk.com> - 2015-09-30 19:45 +0100
    Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-04 09:02 -0700
      Re: Spurious diagnostic messages Bartc <bc@freeuk.com> - 2015-10-04 18:34 +0100
        Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-05 00:23 -0700
      Re: Spurious diagnostic messages Keith Thompson <kst-u@mib.org> - 2015-10-04 15:56 -0700
        Re: Spurious diagnostic messages supercat@casperkitty.com - 2015-10-04 20:04 -0700
        Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-09 09:13 -0700
          Re: Spurious diagnostic messages Keith Thompson <kst-u@mib.org> - 2015-10-09 13:40 -0700
            Re: Spurious diagnostic messages David Brown <david.brown@hesbynett.no> - 2015-10-10 22:26 +0200
              Re: Spurious diagnostic messages supercat@casperkitty.com - 2015-10-10 13:49 -0700
            Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-14 07:53 -0700
  Re: Spurious diagnostic messages Ian Collins <ian-news@hotmail.com> - 2015-09-27 17:30 +1300
    Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-04 10:26 -0700
      Re: Spurious diagnostic messages Ian Collins <ian-news@hotmail.com> - 2015-10-05 17:02 +1300
        Re: Spurious diagnostic messages Tim Rentsch <txr@alumni.caltech.edu> - 2015-10-09 10:06 -0700

csiph-web