Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Fri, 18 Apr 2025 02:39:19 -0000 (UTC) Organization: A noiseless patient Spider Lines: 28 Message-ID: References: <87y0wjaysg.fsf@gmail.com> <20250407211216.00006238@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 18 Apr 2025 04:39:20 +0200 (CEST) Injection-Info: dont-email.me; posting-host="815e419e5016bffc0d489426d3e0a5c2"; logging-data="2044069"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ar7VqvRgsyeZIz28dHMhC" User-Agent: Pan/0.162 (Pokrosvk) Cancel-Lock: sha1:M7KQRxT3Tx1IBeq53lxrDvUFmLI= Bytes: 1895 On Mon, 7 Apr 2025 22:46:49 +0100, bart wrote: > (In source code, it would also be useful to use 1e9 or 1e12, > unfortunately those normally yield floating point values. Tried Python: >>> type(1e9) >>> round(1e9) 1000000000 >>> round(1e12) 1000000000000 However: >>> round(1e24) 999999999999999983222784 So I tried: >>> import decimal >>> decimal.Decimal("1e24") Decimal('1E+24') >>> int(decimal.Decimal("1e24")) 1000000000000000000000000 which is more like it.