Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The moon is a planet just like the Earth, only it is even deader.


devel / comp.lang.c / Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

SubjectAuthor
* Hierarchy among minimum-width types (and also among fastestarnab chatterjee
`* Re: Hierarchy among minimum-width types (and also among fastest minimum-width tyTim Rentsch
 +* Re: Hierarchy among minimum-width types (and also among fastestarnab chatterjee
 |`* Re: Hierarchy among minimum-width types (and also among fastestKaz Kylheku
 | `* Re: Hierarchy among minimum-width types (and also among fastestarnab chatterjee
 |  +- Re: Hierarchy among minimum-width types (and also among fastestarnab chatterjee
 |  `- Re: Hierarchy among minimum-width types (and also among fastest minimum-width tyTim Rentsch
 `- Re: Hierarchy among minimum-width types (and also among fastestarnab chatterjee

1
Hierarchy among minimum-width types (and also among fastest minimum-width types)

<f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27305&group=comp.lang.c#27305

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:558e:b0:63c:f3e3:8220 with SMTP id mi14-20020a056214558e00b0063cf3e38220mr100662qvb.0.1691562631264;
Tue, 08 Aug 2023 23:30:31 -0700 (PDT)
X-Received: by 2002:a05:6808:2184:b0:3a4:24bc:125f with SMTP id
be4-20020a056808218400b003a424bc125fmr1105963oib.1.1691562630990; Tue, 08 Aug
2023 23:30:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 8 Aug 2023 23:30:30 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=157.40.243.126; posting-account=xxYVqQoAAAA0dTZJaXjtAqb6GD4t-dYb
NNTP-Posting-Host: 157.40.243.126
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com>
Subject: Hierarchy among minimum-width types (and also among fastest
minimum-width types)
From: arnabcha...@gmail.com (arnab chatterjee)
Injection-Date: Wed, 09 Aug 2023 06:30:31 +0000
Content-Type: text/plain; charset="UTF-8"
 by: arnab chatterjee - Wed, 9 Aug 2023 06:30 UTC

Hello all,

Does the specification of minimum-width integer types (in <stdint.h>) assure the
expected integer rank hierarchy among them? For example in a hypothetical system
where there is no 32-bit wide type (nor any basic type having width in the range
[32, 63]) and both int and long are 64-bit wide, is it possible for a conforming
implementation to define int_least32_t as long and int_least64_t as int, thereby
implying that int_least32_t has a higher rank than int_least64_t?

Same question also applies for hierarchy among the fastest minimum-width types.
Continuing with the earlier example (and further assuming that both int and long
are equally fast), is it possible for a conforming implementation to define
int_fast32_t as long and int_fast64_t as int (inverting the expected hierarchy)?

Regards,
cHaR.

Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

<86pm3waeb1.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27307&group=comp.lang.c#27307

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)
Date: Wed, 09 Aug 2023 00:02:42 -0700
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <86pm3waeb1.fsf@linuxsc.com>
References: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="c08257b67d6868119c472d7304d82d93";
logging-data="4009678"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EDfs0verepCWnLVvUDxRg1sTJbPtRxtg="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:HjPkS5RK4TYWV5KzN6gNrjpEa08=
sha1:y82ReRX1yswYebbd4mMg99DuO6s=
 by: Tim Rentsch - Wed, 9 Aug 2023 07:02 UTC

arnab chatterjee <arnabchatterjeeofficial@gmail.com> writes:

> Does the specification of minimum-width integer types (in
> <stdint.h>) assure the expected integer rank hierarchy among them?

No.

> For example in a hypothetical system where there is no 32-bit wide
> type (nor any basic type having width in the range [32, 63]) and
> both int and long are 64-bit wide, is it possible for a conforming
> implementation to define int_least32_t as long and int_least64_t as
> int, thereby implying that int_least32_t has a higher rank than
> int_least64_t?

Yes, assuming what you mean by "basic types" is the standard integer
types, and that this condition also applies to extended integer
types. All of the types in <stdint.h> are allowed to be extended
integer types.

> Same question also applies for hierarchy among the fastest
> minimum-width types. Continuing with the earlier example (and
> further assuming that both int and long are equally fast), is it
> possible for a conforming implementation to define int_fast32_t as
> long and int_fast64_t as int (inverting the expected hierarchy)?

Same answer as above.

Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

<a3b84f0b-3dac-471d-9858-18c8e77bf95an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27311&group=comp.lang.c#27311

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:291:b0:635:e9f6:9470 with SMTP id l17-20020a056214029100b00635e9f69470mr103356qvv.5.1691568021394;
Wed, 09 Aug 2023 01:00:21 -0700 (PDT)
X-Received: by 2002:a05:6870:b7ac:b0:1bf:51f7:b5b4 with SMTP id
ed44-20020a056870b7ac00b001bf51f7b5b4mr646750oab.7.1691568021009; Wed, 09 Aug
2023 01:00:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 9 Aug 2023 01:00:20 -0700 (PDT)
In-Reply-To: <86pm3waeb1.fsf@linuxsc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=157.40.118.92; posting-account=xxYVqQoAAAA0dTZJaXjtAqb6GD4t-dYb
NNTP-Posting-Host: 157.40.118.92
References: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com> <86pm3waeb1.fsf@linuxsc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a3b84f0b-3dac-471d-9858-18c8e77bf95an@googlegroups.com>
Subject: Re: Hierarchy among minimum-width types (and also among fastest
minimum-width types)
From: arnabcha...@gmail.com (arnab chatterjee)
Injection-Date: Wed, 09 Aug 2023 08:00:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 26
 by: arnab chatterjee - Wed, 9 Aug 2023 08:00 UTC

On Wednesday, August 9, 2023 at 12:03:00 AM UTC-7, Tim Rentsch wrote:
> arnab chatterjee <arnabchatte...@gmail.com> writes:
>
> > Does the specification of minimum-width integer types (in
> > <stdint.h>) assure the expected integer rank hierarchy among them?
> No.
> > For example in a hypothetical system where there is no 32-bit wide
> > type (nor any basic type having width in the range [32, 63]) and
> > both int and long are 64-bit wide, is it possible for a conforming
> > implementation to define int_least32_t as long and int_least64_t as
> > int, thereby implying that int_least32_t has a higher rank than
> > int_least64_t?
> Yes, assuming what you mean by "basic types" is the standard integer
> types, and that this condition also applies to extended integer
> types. All of the types in <stdint.h> are allowed to be extended
> integer types.
> > Same question also applies for hierarchy among the fastest
> > minimum-width types. Continuing with the earlier example (and
> > further assuming that both int and long are equally fast), is it
> > possible for a conforming implementation to define int_fast32_t as
> > long and int_fast64_t as int (inverting the expected hierarchy)?
> Same answer as above.

Thank you for confirming this; it looks a little counter-intuitive to me, but I guess its quite unlikely to encounter any such implementation in practice.

Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

<5bc131e2-759f-4142-b23d-0afb7a4d2c14n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27312&group=comp.lang.c#27312

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:5c6:b0:403:3683:62a2 with SMTP id d6-20020a05622a05c600b00403368362a2mr29085qtb.11.1691568248971;
Wed, 09 Aug 2023 01:04:08 -0700 (PDT)
X-Received: by 2002:a05:6870:f811:b0:1b0:4e46:7f13 with SMTP id
fr17-20020a056870f81100b001b04e467f13mr19591575oab.2.1691568248603; Wed, 09
Aug 2023 01:04:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 9 Aug 2023 01:04:08 -0700 (PDT)
In-Reply-To: <86pm3waeb1.fsf@linuxsc.com>
Injection-Info: google-groups.googlegroups.com; posting-host=157.40.118.92; posting-account=xxYVqQoAAAA0dTZJaXjtAqb6GD4t-dYb
NNTP-Posting-Host: 157.40.118.92
References: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com> <86pm3waeb1.fsf@linuxsc.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5bc131e2-759f-4142-b23d-0afb7a4d2c14n@googlegroups.com>
Subject: Re: Hierarchy among minimum-width types (and also among fastest
minimum-width types)
From: arnabcha...@gmail.com (arnab chatterjee)
Injection-Date: Wed, 09 Aug 2023 08:04:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2758
 by: arnab chatterjee - Wed, 9 Aug 2023 08:04 UTC

On Wednesday, August 9, 2023 at 12:03:00 AM UTC-7, Tim Rentsch wrote:
> arnab chatterjee <arnabchatte...@gmail.com> writes:
>
> > Does the specification of minimum-width integer types (in
> > <stdint.h>) assure the expected integer rank hierarchy among them?
> No.
> > For example in a hypothetical system where there is no 32-bit wide
> > type (nor any basic type having width in the range [32, 63]) and
> > both int and long are 64-bit wide, is it possible for a conforming
> > implementation to define int_least32_t as long and int_least64_t as
> > int, thereby implying that int_least32_t has a higher rank than
> > int_least64_t?
> Yes, assuming what you mean by "basic types" is the standard integer
> types, and that this condition also applies to extended integer
> types. All of the types in <stdint.h> are allowed to be extended
> integer types.
> > Same question also applies for hierarchy among the fastest
> > minimum-width types. Continuing with the earlier example (and
> > further assuming that both int and long are equally fast), is it
> > possible for a conforming implementation to define int_fast32_t as
> > long and int_fast64_t as int (inverting the expected hierarchy)?
> Same answer as above.

Thank you for confirming this; it looks a little counter-intuitive to me, but I
guess its quite unlikely to encounter any such implementation in practice.

Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

<20230809080730.114@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27346&group=comp.lang.c#27346

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED.s010614aedbccc4a9.vc.shawcable.net!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Hierarchy among minimum-width types (and also among fastest
minimum-width types)
Date: Wed, 9 Aug 2023 15:18:01 -0000 (UTC)
Organization: A noiseless patient Spider
Message-ID: <20230809080730.114@kylheku.com>
References: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com>
<86pm3waeb1.fsf@linuxsc.com>
<a3b84f0b-3dac-471d-9858-18c8e77bf95an@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 9 Aug 2023 15:18:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="s010614aedbccc4a9.vc.shawcable.net:70.79.182.7";
logging-data="1171"; mail-complaints-to="abuse@eternal-september.org"
User-Agent: slrn/1.0.3 (Linux)
 by: Kaz Kylheku - Wed, 9 Aug 2023 15:18 UTC

On 2023-08-09, arnab chatterjee <arnabchatterjeeofficial@gmail.com> wrote:
> On Wednesday, August 9, 2023 at 12:03:00 AM UTC-7, Tim Rentsch wrote:
>> arnab chatterjee <arnabchatte...@gmail.com> writes:
>>
>> > Does the specification of minimum-width integer types (in
>> > <stdint.h>) assure the expected integer rank hierarchy among them?
>> No.
>> > For example in a hypothetical system where there is no 32-bit wide
>> > type (nor any basic type having width in the range [32, 63]) and
>> > both int and long are 64-bit wide, is it possible for a conforming
>> > implementation to define int_least32_t as long and int_least64_t as
>> > int, thereby implying that int_least32_t has a higher rank than
>> > int_least64_t?
>> Yes, assuming what you mean by "basic types" is the standard integer
>> types, and that this condition also applies to extended integer
>> types. All of the types in <stdint.h> are allowed to be extended
>> integer types.
>> > Same question also applies for hierarchy among the fastest
>> > minimum-width types. Continuing with the earlier example (and
>> > further assuming that both int and long are equally fast), is it
>> > possible for a conforming implementation to define int_fast32_t as
>> > long and int_fast64_t as int (inverting the expected hierarchy)?
>> Same answer as above.
>
> Thank you for confirming this; it looks a little counter-intuitive to
> me, but I guess its quite unlikely to encounter any such
> implementation in practice.

It's not counter-intuitive; it's just that what you would find
intuitive is not imposed as a requirement. Implementors that care
about this can observe the ordering.

The least and fast types are chosen in programming situations in
which the exact size and identity of the type doesn't matter,
just that it holds at least a certain number of bits and is oriented
toward a particular time-space tradeoff.

Since the exact size of the type by itself doesn't matter, why would
its exact size or rank in comparison to another type matter.

That's the intuition: if the exact value doesn't matter in isolation, it
doesn't matter in comparison.

E.g. if you say that you believe that wealth doesn't matter, as long as
you're comfortably off, but then compare your wealth to richer people,
that is a contradiction, showing that your belief is not sincere.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

<977ab12b-b6b8-42f9-b630-b1377b3f8ab5n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27377&group=comp.lang.c#27377

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:968:b0:63d:3055:4815 with SMTP id do8-20020a056214096800b0063d30554815mr14354qvb.7.1691643617096;
Wed, 09 Aug 2023 22:00:17 -0700 (PDT)
X-Received: by 2002:a05:6a00:1301:b0:674:1663:1270 with SMTP id
j1-20020a056a00130100b0067416631270mr610866pfu.4.1691643616233; Wed, 09 Aug
2023 22:00:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 9 Aug 2023 22:00:15 -0700 (PDT)
In-Reply-To: <20230809080730.114@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=157.40.82.145; posting-account=xxYVqQoAAAA0dTZJaXjtAqb6GD4t-dYb
NNTP-Posting-Host: 157.40.82.145
References: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com>
<86pm3waeb1.fsf@linuxsc.com> <a3b84f0b-3dac-471d-9858-18c8e77bf95an@googlegroups.com>
<20230809080730.114@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <977ab12b-b6b8-42f9-b630-b1377b3f8ab5n@googlegroups.com>
Subject: Re: Hierarchy among minimum-width types (and also among fastest
minimum-width types)
From: arnabcha...@gmail.com (arnab chatterjee)
Injection-Date: Thu, 10 Aug 2023 05:00:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4667
 by: arnab chatterjee - Thu, 10 Aug 2023 05:00 UTC

On Wednesday, August 9, 2023 at 8:18:15 AM UTC-7, Kaz Kylheku wrote:
> On 2023-08-09, arnab chatterjee <arnabchatte...@gmail.com> wrote:
> > On Wednesday, August 9, 2023 at 12:03:00 AM UTC-7, Tim Rentsch wrote:
> >> arnab chatterjee <arnabchatte...@gmail.com> writes:
> >>
> >> > Does the specification of minimum-width integer types (in
> >> > <stdint.h>) assure the expected integer rank hierarchy among them?
> >> No.
> >> > For example in a hypothetical system where there is no 32-bit wide
> >> > type (nor any basic type having width in the range [32, 63]) and
> >> > both int and long are 64-bit wide, is it possible for a conforming
> >> > implementation to define int_least32_t as long and int_least64_t as
> >> > int, thereby implying that int_least32_t has a higher rank than
> >> > int_least64_t?
> >> Yes, assuming what you mean by "basic types" is the standard integer
> >> types, and that this condition also applies to extended integer
> >> types. All of the types in <stdint.h> are allowed to be extended
> >> integer types.
> >> > Same question also applies for hierarchy among the fastest
> >> > minimum-width types. Continuing with the earlier example (and
> >> > further assuming that both int and long are equally fast), is it
> >> > possible for a conforming implementation to define int_fast32_t as
> >> > long and int_fast64_t as int (inverting the expected hierarchy)?
> >> Same answer as above.
> >
> > Thank you for confirming this; it looks a little counter-intuitive to
> > me, but I guess its quite unlikely to encounter any such
> > implementation in practice.
> It's not counter-intuitive; it's just that what you would find
> intuitive is not imposed as a requirement. Implementors that care
> about this can observe the ordering.
>
> The least and fast types are chosen in programming situations in
> which the exact size and identity of the type doesn't matter,
> just that it holds at least a certain number of bits and is oriented
> toward a particular time-space tradeoff.
>
> Since the exact size of the type by itself doesn't matter, why would
> its exact size or rank in comparison to another type matter.
>
> That's the intuition: if the exact value doesn't matter in isolation, it
> doesn't matter in comparison.
>
> E.g. if you say that you believe that wealth doesn't matter, as long as
> you're comfortably off, but then compare your wealth to richer people,
> that is a contradiction, showing that your belief is not sincere.
>
> --
> TXR Programming Language: http://nongnu.org/txr
> Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
> Mastodon: @Kazi...@mstdn.ca

Agreed, but it wouldn't harm if such a hierarchy were imposed as a requirement.
Width being an indicator of precision it makes sense that if a type is intended
to be at least as precise as another, then rank of the former should be higher
than that of the latter (aligned with the requirement for basic integer types).
It would look strange if operating on values of types int_least32_t and
int_least64_t gives the result with type int_least32_t.

Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

<9280320f-79a2-44f4-a2c2-d7c0c79e8c6bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27378&group=comp.lang.c#27378

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:118f:b0:40f:2462:a356 with SMTP id m15-20020a05622a118f00b0040f2462a356mr15989qtk.12.1691645884758;
Wed, 09 Aug 2023 22:38:04 -0700 (PDT)
X-Received: by 2002:a17:902:e80f:b0:1bb:1ffd:5cc8 with SMTP id
u15-20020a170902e80f00b001bb1ffd5cc8mr487678plg.11.1691645884075; Wed, 09 Aug
2023 22:38:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Wed, 9 Aug 2023 22:38:03 -0700 (PDT)
In-Reply-To: <977ab12b-b6b8-42f9-b630-b1377b3f8ab5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=157.40.89.163; posting-account=xxYVqQoAAAA0dTZJaXjtAqb6GD4t-dYb
NNTP-Posting-Host: 157.40.89.163
References: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com>
<86pm3waeb1.fsf@linuxsc.com> <a3b84f0b-3dac-471d-9858-18c8e77bf95an@googlegroups.com>
<20230809080730.114@kylheku.com> <977ab12b-b6b8-42f9-b630-b1377b3f8ab5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9280320f-79a2-44f4-a2c2-d7c0c79e8c6bn@googlegroups.com>
Subject: Re: Hierarchy among minimum-width types (and also among fastest
minimum-width types)
From: arnabcha...@gmail.com (arnab chatterjee)
Injection-Date: Thu, 10 Aug 2023 05:38:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 85
 by: arnab chatterjee - Thu, 10 Aug 2023 05:38 UTC

On Wednesday, August 9, 2023 at 10:00:26 PM UTC-7, arnab chatterjee wrote:
> On Wednesday, August 9, 2023 at 8:18:15 AM UTC-7, Kaz Kylheku wrote:
> > On 2023-08-09, arnab chatterjee <arnabchatte...@gmail.com> wrote:
> > > On Wednesday, August 9, 2023 at 12:03:00 AM UTC-7, Tim Rentsch wrote:
> > >> arnab chatterjee <arnabchatte...@gmail.com> writes:
> > >>
> > >> > Does the specification of minimum-width integer types (in
> > >> > <stdint.h>) assure the expected integer rank hierarchy among them?
> > >> No.
> > >> > For example in a hypothetical system where there is no 32-bit wide
> > >> > type (nor any basic type having width in the range [32, 63]) and
> > >> > both int and long are 64-bit wide, is it possible for a conforming
> > >> > implementation to define int_least32_t as long and int_least64_t as
> > >> > int, thereby implying that int_least32_t has a higher rank than
> > >> > int_least64_t?
> > >> Yes, assuming what you mean by "basic types" is the standard integer
> > >> types, and that this condition also applies to extended integer
> > >> types. All of the types in <stdint.h> are allowed to be extended
> > >> integer types.
> > >> > Same question also applies for hierarchy among the fastest
> > >> > minimum-width types. Continuing with the earlier example (and
> > >> > further assuming that both int and long are equally fast), is it
> > >> > possible for a conforming implementation to define int_fast32_t as
> > >> > long and int_fast64_t as int (inverting the expected hierarchy)?
> > >> Same answer as above.
> > >
> > > Thank you for confirming this; it looks a little counter-intuitive to
> > > me, but I guess its quite unlikely to encounter any such
> > > implementation in practice.
> > It's not counter-intuitive; it's just that what you would find
> > intuitive is not imposed as a requirement. Implementors that care
> > about this can observe the ordering.
> >
> > The least and fast types are chosen in programming situations in
> > which the exact size and identity of the type doesn't matter,
> > just that it holds at least a certain number of bits and is oriented
> > toward a particular time-space tradeoff.
> >
> > Since the exact size of the type by itself doesn't matter, why would
> > its exact size or rank in comparison to another type matter.
> >
> > That's the intuition: if the exact value doesn't matter in isolation, it
> > doesn't matter in comparison.
> >
> > E.g. if you say that you believe that wealth doesn't matter, as long as
> > you're comfortably off, but then compare your wealth to richer people,
> > that is a contradiction, showing that your belief is not sincere.
> >
> > --
> > TXR Programming Language: http://nongnu.org/txr
> > Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
> > Mastodon: @Kazi...@mstdn.ca
> Agreed, but it wouldn't harm if such a hierarchy were imposed as a requirement.
> Width being an indicator of precision it makes sense that if a type is intended
> to be at least as precise as another, then rank of the former should be higher
> than that of the latter (aligned with the requirement for basic integer types).
> It would look strange if operating on values of types int_least32_t and
> int_least64_t gives the result with type int_least32_t.

"... then rank of the former should be higher than that of the latter ..."

Correction: The above line was meant to be

"... then rank of the former should not be lower than that of the latter ...."

Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)

<86msyw854g.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27518&group=comp.lang.c#27518

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: Hierarchy among minimum-width types (and also among fastest minimum-width types)
Date: Sat, 12 Aug 2023 11:53:03 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <86msyw854g.fsf@linuxsc.com>
References: <f0889fe7-1103-4ef4-aa36-b0f39562e364n@googlegroups.com> <86pm3waeb1.fsf@linuxsc.com> <a3b84f0b-3dac-471d-9858-18c8e77bf95an@googlegroups.com> <20230809080730.114@kylheku.com> <977ab12b-b6b8-42f9-b630-b1377b3f8ab5n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="744b704e16faf359564fcd4001f85eba";
logging-data="1548491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MfJvcYDIPGVPSUrx1Vmp9gQwIYxXgtqc="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:sokk1uIhCi1/v73tC0FEaKKxJOo=
sha1:3U6VliLRvXX6u9Oj6QQrc2NbvtU=
 by: Tim Rentsch - Sat, 12 Aug 2023 18:53 UTC

arnab chatterjee <arnabchatterjeeofficial@gmail.com> writes:

[should types like intleastN_t have rules about their conversion
ranks?]

> Agreed, but it wouldn't harm if such a hierarchy were imposed as a
> requirement. [...]

There is no good reason to do it. The cost of adding such a
rule to the C standard is greater than zero, both initially
and in additional ongoing cost. Given that (a) it almost
never comes up, and (b) if/when it does it almost never
causes any material difference, the balance is in favor of
leaving things as they are and not putting in some rule that
offers negligible value and also easily can be taken care of
in those extremely rare situations where it (theoretically)
matters.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor