Sujet : Re: "A diagram of C23 basic types"
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 07. Apr 2025, 19:02:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vt13vp$bjs0$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 04/04/2025 04:01, Lawrence D'Oliveiro wrote:
On Wed, 2 Apr 2025 16:33:46 +0100, bart wrote:
Here, tell me at a glance the magnitude of
this number:
>
10000000000
#define THOUSAND 1000
#define MILLION (THOUSAND * THOUSAND)
#define BILLION (THOUSAND * MILLION)
uint64 num = 10 * BILLION;
Much easier to figure out, don’t you think?
Try 20 * BILLION; it will overflow if not careful.
I'd normally write '20 billion' outside of C, since I use such numbers, with lots of zeros, constantly when writing test code.
But when it isn't all zeros, or the base isn't 10, then numeric separators are better.