Liste des Groupes | Revenir à cl c |
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?
(In source code, it would also be useful to use 1e9 or 1e12, unfortunately those normally yield floating point values. I can't do much about that in C, but I will see what can be done with my own stuff.)Since numbers using exponents without also using decimal points are rare in my code base, I've decided to experiment with numbers like 1e6 being integer constants rather that floats. (This is IN my language.)
Les messages affichés proviennent d'usenet.