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


Groups > comp.lang.c++ > #70221 > unrolled thread

What does the "L" mean

Started byT <T@invalid.invalid>
First post2019-12-03 23:38 -0800
Last post2019-12-05 10:03 -0800
Articles 4 on this page of 44 — 17 participants

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


Contents

  What does the "L" mean T <T@invalid.invalid> - 2019-12-03 23:38 -0800
    Re: What does the "L" mean Bonita Montero <Bonita.Montero@gmail.com> - 2019-12-04 08:43 +0100
      Re: What does the "L" mean T <T@invalid.invalid> - 2019-12-04 00:05 -0800
        Re: What does the "L" mean Geoff <geoff@invalid.invalid> - 2019-12-04 00:32 -0800
          Re: What does the "L" mean T <T@invalid.invalid> - 2019-12-04 00:33 -0800
          Re: What does the "L" mean Paavo Helde <myfirstname@osa.pri.ee> - 2019-12-04 11:11 +0200
            Re: What does the "L" mean Geoff <geoff@invalid.invalid> - 2019-12-04 01:14 -0800
        Re: What does the "L" mean "Fred. Zwarts" <F.Zwarts@KVI.nl> - 2019-12-04 09:39 +0100
          Re: What does the "L" mean T <T@invalid.invalid> - 2019-12-04 00:51 -0800
        Re: What does the "L" mean Paavo Helde <myfirstname@osa.pri.ee> - 2019-12-04 10:40 +0200
          Re: What does the "L" mean T <T@invalid.invalid> - 2019-12-04 00:56 -0800
            Re: What does the "L" mean Bo Persson <bo@bo-persson.se> - 2019-12-04 10:08 +0100
              Re: What does the "L" mean T <T@invalid.invalid> - 2019-12-04 01:20 -0800
                Re: What does the "L" mean Vir Campestris <vir.campestris@invalid.invalid> - 2019-12-04 21:46 +0000
                  Re: What does the "L" mean Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-12-05 01:33 +0000
                    Re: What does the "L" mean Vir Campestris <vir.campestris@invalid.invalid> - 2019-12-05 15:15 +0000
                      Re: What does the "L" mean Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-12-05 15:31 +0000
                        Re: What does the "L" mean Vir Campestris <vir.campestris@invalid.invalid> - 2019-12-06 10:59 +0000
                          Re: What does the "L" mean Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-12-07 03:55 +0000
                            Re: What does the "L" mean James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-12-06 23:38 -0500
                            Re: What does the "L" mean Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-12-06 22:36 -0800
                              Re: What does the "L" mean Vir Campestris <vir.campestris@invalid.invalid> - 2019-12-08 21:33 +0000
                      Re: What does the "L" mean Bart <bc@freeuk.com> - 2019-12-06 20:44 +0000
                  Re: What does the "L" mean Bart <bc@freeuk.com> - 2019-12-06 20:52 +0000
                  Re: What does the "L" mean Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-12-06 22:20 -0800
          Re: What does the "L" mean Bart <bc@freeuk.com> - 2019-12-06 16:20 +0000
            Re: What does the "L" mean boltar@nowhere.co.uk - 2019-12-06 16:30 +0000
              Re: What does the "L" mean Bart <bc@freeuk.com> - 2019-12-06 17:50 +0000
                Re: What does the "L" mean scott@slp53.sl.home (Scott Lurndal) - 2019-12-06 18:18 +0000
                Re: What does the "L" mean boltar@nowhere.co.uk - 2019-12-07 11:57 +0000
                  Re: What does the "L" mean Bart <bc@freeuk.com> - 2019-12-07 12:04 +0000
                    Re: What does the "L" mean boltar@nowhere.co.uk - 2019-12-07 13:05 +0000
                      Re: What does the "L" mean Bart <bc@freeuk.com> - 2019-12-07 13:16 +0000
                        Re: What does the "L" mean Öö Tiib <ootiib@hot.ee> - 2019-12-07 05:49 -0800
            Re: What does the "L" mean scott@slp53.sl.home (Scott Lurndal) - 2019-12-06 16:36 +0000
        Re: What does the "L" mean Bonita Montero <Bonita.Montero@gmail.com> - 2019-12-04 13:47 +0100
          Re: What does the "L" mean Thiago Adams <thiago.adams@gmail.com> - 2019-12-04 04:57 -0800
          Re: What does the "L" mean "Fred. Zwarts" <F.Zwarts@KVI.nl> - 2019-12-04 14:41 +0100
            Re: What does the "L" mean Bonita Montero <Bonita.Montero@gmail.com> - 2019-12-04 15:06 +0100
          Re: What does the "L" mean James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-12-04 08:55 -0500
      Re: What does the "L" mean T <T@invalid.invalid> - 2019-12-04 00:34 -0800
    Re: What does the "L" mean Keith Thompson <kst-u@mib.org> - 2019-12-04 08:28 -0800
      Re: What does the "L" mean Robert Wessel <robertwessel2@yahoo.com> - 2019-12-05 09:32 -0600
        Re: What does the "L" mean Keith Thompson <kst-u@mib.org> - 2019-12-05 10:03 -0800

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


#70226

FromT <T@invalid.invalid>
Date2019-12-04 00:34 -0800
Message-ID<qs7r2f$kpb$2@dont-email.me>
In reply to#70222
On 2019-12-03 23:43, Bonita Montero wrote:
> Am 04.12.2019 um 08:38 schrieb T:
>> Hi All
>> MB_ICONEXCLAMATION
>> 0x00000030L
>> What does the "L" at the end mean?
> 
> It means that the integral literal is a long.

Thank you!

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


#70242

FromKeith Thompson <kst-u@mib.org>
Date2019-12-04 08:28 -0800
Message-ID<ln4kyg12e0.fsf@kst-u.example.com>
In reply to#70221
T <T@invalid.invalid> writes:
> MB_ICONEXCLAMATION
> 0x00000030L
>
> What does the "L" at the end mean?

The type of a hexadecimal integer literal with an "L" suffix is of the
first of
    long int
    unsigned long int
    long long int
    unsigned long long int
in which its value will fit (C++11 2.14.2 [lex.icon]).  Since long
int is guaranteed to be at least 32 bits, 0x00000030L is of type
long int.

The leading 0s are presumably intended to imply a 32-bit quantity,
which is probably the case for the system for which the code is
intended, but it's not guaranteed.  (64-bit Linux-based systems
usually have 64-bit long; on such systems 0x00000030L is 64 bits.
It's *always* of type long int under any conforming implementations.)
Leading zeros are ignored.  0x00000000000000000000000000000030L
is equivalent to 0x00000030L.

A conforming implementation could make long int any size 32 bits
or wider.  The size in bits is a multiple of CHAR_BIT, which is at
least 8.  An implementation could have 33-bit long int; on such a
system characters would have to be either 11 or 33 bits.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for Philips Healthcare
void Void(void) { Void(); } /* The recursive call of the void */

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


#70285

FromRobert Wessel <robertwessel2@yahoo.com>
Date2019-12-05 09:32 -0600
Message-ID<1m8iuedmre4j8aiadhohmcaskje6ghirle@4ax.com>
In reply to#70242
On Wed, 04 Dec 2019 08:28:23 -0800, Keith Thompson <kst-u@mib.org>
wrote:

>T <T@invalid.invalid> writes:
>> MB_ICONEXCLAMATION
>> 0x00000030L
>>
>> What does the "L" at the end mean?
>
>The type of a hexadecimal integer literal with an "L" suffix is of the
>first of
>    long int
>    unsigned long int
>    long long int
>    unsigned long long int
>in which its value will fit (C++11 2.14.2 [lex.icon]).  Since long
>int is guaranteed to be at least 32 bits, 0x00000030L is of type
>long int.
>
>The leading 0s are presumably intended to imply a 32-bit quantity,
>which is probably the case for the system for which the code is
>intended, but it's not guaranteed.  (64-bit Linux-based systems
>usually have 64-bit long; on such systems 0x00000030L is 64 bits.
>It's *always* of type long int under any conforming implementations.)
>Leading zeros are ignored.  0x00000000000000000000000000000030L
>is equivalent to 0x00000030L.
>
>A conforming implementation could make long int any size 32 bits
>or wider.  The size in bits is a multiple of CHAR_BIT, which is at
>least 8.  An implementation could have 33-bit long int; on such a
>system characters would have to be either 11 or 33 bits.


To be pedantic, aren't longs allowed to have pad bits?  Thus you could
have a 33-bit long stored in five 8-bit characters.

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


#70291

FromKeith Thompson <kst-u@mib.org>
Date2019-12-05 10:03 -0800
Message-ID<lnzhg6zm3l.fsf@kst-u.example.com>
In reply to#70285
Robert Wessel <robertwessel2@yahoo.com> writes:
> On Wed, 04 Dec 2019 08:28:23 -0800, Keith Thompson <kst-u@mib.org>
> wrote:
[...]
>>A conforming implementation could make long int any size 32 bits
>>or wider.  The size in bits is a multiple of CHAR_BIT, which is at
>>least 8.  An implementation could have 33-bit long int; on such a
>>system characters would have to be either 11 or 33 bits.
>
> To be pedantic, aren't longs allowed to have pad bits?  Thus you could
> have a 33-bit long stored in five 8-bit characters.

Yes, C++ permits padding bits (bits that do not contribute to
the value).  You're suggesting a long type with a *size* of 5
bytes / 40 bits and a *width* of 33 bits, which is permitted.
(The width includes the sign bit.)

When I wrote "33-bit long int", I meant
    CHAR_BIT * sizeof (long int) == 33
I could have made that clearer.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for Philips Healthcare
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [standalone]


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

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


csiph-web