| Deutsch English Français Italiano |
|
<20250626235916.00003314@yahoo.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: "A diagram of C23 basic types" Date: Thu, 26 Jun 2025 23:59:16 +0300 Organization: A noiseless patient Spider Lines: 57 Message-ID: <20250626235916.00003314@yahoo.com> References: <87y0wjaysg.fsf@gmail.com> <20250403150210.000020f8@yahoo.com> <86selt8lxv.fsf@linuxsc.com> <20250428162738.00007c1d@yahoo.com> <103j290$3bv4a$1@dont-email.me> <8734bm1eqz.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Date: Thu, 26 Jun 2025 22:59:20 +0200 (CEST) Injection-Info: dont-email.me; posting-host="35f4ca83b414c3b09e60b207333327b3"; logging-data="3822324"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/i8nSTe1eSpcoJTQEljxktHgzkC6dP8ns=" Cancel-Lock: sha1:w9bhYPo9ix2MlZJAghx3tpkX0XE= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32) On Thu, 26 Jun 2025 12:31:32 -0700 Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > Lawrence D'Oliveiro <ldo@nz.invalid> writes: > > On Mon, 28 Apr 2025 16:27:38 +0300, Michael S wrote: =20 > >> IMHO, a need for a common name for IEEE binary128 exists for quite > >> some time. For IEEE binary256 the real need didn't emerge yet. But > >> it will emerge in the hopefully near future. =20 > > > > A thought: the main advantage of binary types over decimal is > > supposed to be speed. Once you get up to larger precisions like > > that, the speed advantage becomes less clear, particularly since > > hardware support doesn=E2=80=99t seem forthcoming any time soon. There = are > > already variable-precision decimal floating-point libraries > > available. And with such calculations, C no longer offers a great > > performance advantage over a higher-level language, so you might as > > well use the higher-level language. > > > > <https://docs.python.org/3/library/decimal.html> =20 >=20 > I think there's an implicit assumption that, all else being equal, > decimal is better than binary. That's true in some contexts, > but not in all. >=20 My implicit assumption is that other sings being equal binary is better than anything else because it has the lowest variation in ULP to value ratio.=20 The fact that other things being equal binary fp also tends to be faster is a nice secondary advantage. For example, it is easy to imagine hardware that implements S/360 style hex floating point as fast or a little faster than binary fp, but numerec properties of it are much worse then sane implementations of binary fp. Of course, historically there existed bad implementations of binary fp as weel, most notably on many CDC machines. But by now they are dead for eons. > If you're performing calculations on physical quantities, decimal > probably has no particular advantages, and binary is likely to be > more efficient in both time and space. >=20 > The advantagers of decimal show up if you're formatting a *lot* > of numbers in human-readable form (but nobody has time to read a > billion numbers), or if you're working with money. But for financial > calculations, particularly compound interest, there are likely to > be precise regulations about how to round results. A given decimal > floating-point format might or might not satisfy those regulations. >=20 Exactly.