Article View: comp.lang.c
Article #969Re: .5 against 0.5f
From: Michael S
Date: Wed, 28 Oct 2026 20:25
Date: Wed, 28 Oct 2026 20:25
30 lines
2283 bytes
2283 bytes
On Wed, 28 Oct 2026 08:39:23 +0100 David Brown <david.brown@hesbynett.no> wrote: > On 28/10/2026 01:49, Lawrence D’Oliveiro wrote: > > On Tue, 27 Oct 2026 18:06:25 -0400, James Kuyper wrote: > > > >> However, if you need double precision, you shouldn't be using the > >> "f" suffix. > > > > Is there any situation where you *should* use the “f” suffix? > > > > I am thinking: no. > > Try thinking harder. > > I use the "f" suffix all the time in my code, because I do not want > double precision. In many situations, single precision arithmetic is > at least twice as fast as double precision - in some situations it > can be two orders of magnitude faster. > > I'd still likely prefer to write it as (float)0.1 instead of 0.1f. It somewhat depends on my mood in specific day, but likelihood is certainly not in favor of 0.1f.
Technical Details
Message-ID:
<20261028222504.00004b8b@yahoo.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me> <11br5td$1to7l$1@dont-email.me> <11br792$1u7e5$1@dont-email.me> <11brgqf$21170$2@dont-email.me> <11bs8rb$26dq0$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: .5 against 0.5f Date: Wed, 28 Oct 2026 22:25:04 +0200 Organization: A noiseless patient Spider Lines: 30 Message-ID: <20261028222504.00004b8b@yahoo.com> References: <11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me> <11br5td$1to7l$1@dont-email.me> <11br792$1u7e5$1@dont-email.me> <11brgqf$21170$2@dont-email.me> <11bs8rb$26dq0$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Date: Wed, 28 Oct 2026 20:25:09 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2850255"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Tbml1oTBU2Nt9xDWGby0eJnk6TBetR/g="; posting-host="3200a54061ecbbbd9ff00ee3880229c4" Cancel-Lock: sha1:pxnpGrazY8l0EbFMIWS2pbaaOUU= sha256:TGBYw1UGST2Ta7ERNkmHjHPAEYoMR+BOfdCJrSGyR3c= sha1:ZXlCzDypRdzvmoBvtMR7DadmNNY= sha256:bH2TUKuYtLVfiZ5LI1tcTjvOyTNBlXZpJ7ZhPFvm72w= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)