Sujet : Re: "A diagram of C23 basic types"
De : rjh (at) *nospam* cpax.org.uk (Richard Heathfield)
Groupes : comp.lang.cDate : 07. Apr 2025, 20:29:17
Autres entêtes
Organisation : Fix this later
Message-ID : <vt192f$h52j$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 07/04/2025 19:12, Michael S wrote:
On Mon, 7 Apr 2025 19:02:34 +0100
bart <bc@freeuk.com> wrote:
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.
>
Is not it "20 milliards" in British English?
Yes. The British use
1 - one
10 - ten
100 - hundred
1 000 - thousand
10 000 - myriad
100 000 - pool
1 000 000 - million
1 000 000 000 - milliard
1 000 000 000 000 - billion
1 000 000 000 000 000 - billiard
1 000 000 000 000 000 000 - trillion
1 000 000 000 000 000 000 000 - trilliard
1 000 000 000 000 000 000 000 000 - snooker
except for journalists, politicians, stockbrokers, and anyone else who spends far too much time talking to Americans.
The biggest number you're likely to need in the real world is 100 tredecimillion, which is approximately the number of atoms in the known universe.
ObC: I am currently roughing out a proposal for the ISO folks to introduce the 288-bit long long long long long long long long long int, or universe_t for short, so that programs will be able to keep track of those 100 tredecimillion atoms. Each universe_t will be able to count atoms in almost five million observable universes, which should be enough to be going on with.
-- Richard HeathfieldEmail: rjh at cpax dot org dot uk"Usenet is a strange place" - dmr 29 July 1999Sig line 4 vacant - apply within