| Deutsch English Français Italiano |
|
<vtuq1n$496v$7@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: Lawrence D'Oliveiro <ldo@nz.invalid>
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: <vtuq1n$496v$7@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>
<vtse0n$1uc55$7@dont-email.me> <vtte95$2um97$1@dont-email.me>
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?