Deutsch   English   Français   Italiano  
<vt2u9a$219ig$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: "A diagram of C23 basic types"
Date: Tue, 8 Apr 2025 11:37:31 +0100
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <vt2u9a$219ig$1@dont-email.me>
References: <87y0wjaysg.fsf@gmail.com> <vsj1m8$1f8h2$1@dont-email.me>
 <vsj2l9$1j0as$1@dont-email.me> <vsjef3$1u4nk$1@dont-email.me>
 <vsjg6t$20pdb$1@dont-email.me> <vsjgjn$1v1n4$1@dont-email.me>
 <vsjk4k$24q5m$1@dont-email.me> <vsjlcp$230a5$1@dont-email.me>
 <vsni1v$291i3$5@dont-email.me> <vt13vp$bjs0$1@dont-email.me>
 <20250407211216.00006238@yahoo.com> <vt14u7$bjs0$2@dont-email.me>
 <vt1bmt$jf54$1@dont-email.me> <vt1h48$n5fs$1@dont-email.me>
 <vt1l83$n5fs$2@dont-email.me> <871pu3d1al.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 08 Apr 2025 12:37:30 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="2f44e72492e5a6a19c1f48ece1af5bd0";
	logging-data="2139728"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19Et3KUOXrUbRJhMOzjfQji"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:XjbPobmI8lxFb1NARAM1VtQrd64=
In-Reply-To: <871pu3d1al.fsf@nosuchdomain.example.com>
Content-Language: en-GB
Bytes: 2495

On 08/04/2025 00:01, Keith Thompson wrote:
> bart <bc@freeuk.com> writes:
> [...]
>> 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.)
> 
> You might want to look at Ada for existing practice.
> 
> In C, a constant with either a decimal point or an exponent is
> floating-point.  In Ada, 1.0e6 is floating-point and 1e6 is an integer.
> Of course this isn't very helpful if you want to represent numbers with
> a lot of non-zero digits; for that, you need digit separators.

The context here /is/ lots of zeros. In the real world, usage such as 
such as 'N million' or 'N billion' typically scales N by a million or 
billion.

But it's good to know I'm copying existing practice from Ada.

(However it turns out that trying to add it to my C compiler is 
pointless; '1e9' needs to be an integer billion across multiple compilers.)