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


Groups > comp.std.c++ > #179

Re: An hexadecimal digits group separator for long 64bit addresses

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!news.glorb.com!news.alt.net
From Niklas Holsti <niklas.holsti@tidorum.invalid>
Newsgroups comp.std.c++
Subject Re: An hexadecimal digits group separator for long 64bit addresses
Date Sat, 25 Jun 2011 14:06:03 CST
Organization Tidorum Ltd
Lines 45
Sender std-cpp-request@vandevoorde.com
Approved james.dennett@gmail.com
Message-ID <96mnalFvp7U1@mid.individual.net> (permalink)
References <f81be81a-36de-482a-ad63-480bec9a9933@x38g2000pri.googlegroups.com> <itdl0j$ltu$1@dont-email.me>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
To undisclosed-recipients:;
Return-Path <cppmods@mcgurn.dreamhost.com>
X-Original-Date Sat, 25 Jun 2011 21:22:13 +0300
X-Submission-Address std-c++-submit@vandevoorde.com
Xref x330-a1.tempe.blueboxinc.net comp.std.c++:179

Show key headers only | View raw


Victor Bazarov wrote:
>
> On 6/16/2011 2:07 PM, Yaniv Abraham wrote:
>>
>>  As 64bit word processors become more and more widespread, some of
>>  which also see embedded applications (such as the NetLogic XLP800-
>>  family of system processors) the current syntax in C and C++ for
>>  hexadecimal numbers notation (and thus their notation of encoding
>>  addresses), a long string of hexadecimal digits with the 0x prefix,
>>  become IMHO too long making it hard to interpret and grasp quickly.
>>  Is there a proposal to `enhance' this notation in the next C/C++
>>  standard to make hexadecimal numbers easier to type and understand?
>>  C/C++ can adopt the notation that technical hardware manuals are using
>>  for a long time of using the `_' character to separate between 4 or 8
>>  nibbles (4bit) sequences of digits (e.g. instead of reading
>>  0xFFFF58AE3BBE33AC I think it will be much easier to read
>>  0xFFFF58AE_3BBE33AC or even 0xFFFF_58AE_3BBE_33AC).
>>  What do you think? Anyone?
>
> My personal opinion is that the underscore in a numerical literal, as a
> symbol that gets simply skipped for the purposes of token parsing (or
> what's the right term?), is long overdue in the C++ syntax.  I would
> even advocate its use in floating point literals (e.g. for Pi I could
> write 3.1415_92653_58979_32384_62643_38327_95 - easy to see there are 32
> digits here).

Good idea. For an example of a language where it is already
implemented see Ada, where you can put underscores between literal
digits (in any base, and for integer literals or floating literals)
but not as the first or last character of the literal. Underscores are
very useful for making long literals readable.

--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
     .      @       .


[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

An hexadecimal digits group separator for long 64bit addresses Yaniv Abraham <yaniv1abraham@gmail.com> - 2011-06-16 12:07 -0600
  Re: An hexadecimal digits group separator for long 64bit addresses Miles Bader<miles@gnu.org> - 2011-06-17 13:17 -0600
  Re: An hexadecimal digits group separator for long 64bit addresses Ed Smith-Rowland<3dw4rd@verizon.net> - 2011-06-17 13:18 -0600
  Re: An hexadecimal digits group separator for long 64bit addresses Victor Bazarov<v.bazarov@comcast.invalid> - 2011-06-17 13:16 -0600
    Re: An hexadecimal digits group separator for long 64bit addresses Niklas Holsti <niklas.holsti@tidorum.invalid> - 2011-06-25 14:06 -0600
      Re: An hexadecimal digits group separator for long 64bit addresses Yakov Galka <ybungalobill@gmail.com> - 2011-06-27 13:38 -0600
        Re: An hexadecimal digits group separator for long 64bit addresses Philip Guenther <guenther@gmail.com> - 2011-06-30 10:30 -0600
          Re: An hexadecimal digits group separator for long 64bit addresses Niklas Holsti <niklas.holsti@tidorum.invalid> - 2011-08-07 13:07 -0600
            Re: An hexadecimal digits group separator for long 64bit addresses Florian Kutscherauer<florian.kutscherauer@gmx.at> - 2011-08-10 11:50 -0600
              Re: An hexadecimal digits group separator for long 64bit addresses Ed Smith-Rowland <3dw4rd@verizon.net> - 2011-08-11 08:19 -0600
                Re: An hexadecimal digits group separator for long 64bit addresses Yakov Galka<ybungalobill@gmail.com> - 2011-08-15 07:46 -0600
                Re: An hexadecimal digits group separator for long 64bit addresses "Martin B." <0xCDCDCDCD@gmx.at> - 2011-08-16 21:29 -0600
                Re: An hexadecimal digits group separator for long 64bit addresses Ed Smith-Rowland <3dw4rd@verizon.net> - 2011-08-18 07:53 -0600
                Re: An hexadecimal digits group separator for long 64bit addresses Leo Equinox Gaspard <ekinox1995@gmail.com> - 2011-08-16 21:29 -0600

csiph-web