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: Sat, 19 Apr 2025 00:16:55 -0000 (UTC) Organization: A noiseless patient Spider Lines: 22 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: Sat, 19 Apr 2025 02:16:55 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b0076e2aa753965293bf6d2868b79ee0"; logging-data="140511"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+M8VNKKD2+BKy8NJMpHyUc" User-Agent: Pan/0.162 (Pokrosvk) Cancel-Lock: sha1:pUu8NVYiDrW4fYF7g5nWOHqrhsE= Bytes: 2021 On Fri, 18 Apr 2025 12:49:56 +0100, bart wrote: > The idea behind writing 1e12 for example was for something that was > compact, quick to type, and easy to grasp. This: > > int(decimal.Decimal("1e24")) > > seems to lack all of those. I would agree with that. But remember, it can be abbreviated†: D = decimal.Decimal then you can just change the above expression to int(D("1e24")) I suppose this is why C++ has introduced user-defined literals. No doubt the Python folks will find some way to provide something similar at some point ... †Why is “abbreviated” such a long word?