Liste des Groupes | Revenir à cl c |
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.
(Actually both 10/20 billion will overflow u32; I was thinking of 20
billion billion overflowing u64.)
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?
We (UK) now use 'billion' for 1E9; in the past it meant 1E12.
'Milliardo' is Italian for 'billion'; perhaps in a few other languages too.
Les messages affichés proviennent d'usenet.