🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1134

Re: .5 against 0.5f

#1134
From: Tim Rentsch
Date: Thu, 29 Oct 2026 22:47
38 lines
3425 bytes
"Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> writes:

> On Thu, 29 Oct 2026 10:45:16 +0100, David Brown wrote:
>
>> Let me put it another way.  What benefit do you think there is from
>> these parentheses?  Why does the FreeBSD style guide recommend them?
>> I can see benefits in consistency of style once that usage has been
>> established, but why have them in the first place?
>
> As we all know, FreeBSD is derived from software developed by
> the CSRG at UC Berkeley during the 70's.  FreeBSD adopted the
> Kernel Normal Format (KNF) from CSRG.  You will need to contact
> a former member of CSRG such as Bostik, McKusick, Joy, Leffler,
> etc.  and them why KNF requires ().
>
> Perhaps, the C compiler from 40 or so years ago required
> parentheses in a return statement.  Or, just maybe, members of
> CSRG read K&R and noticed the authors of the book consistently
> use paretheses in their examples.  Ah yes, let's look at
> the documentation:
>
> % man 9 style
>
> HISTORY
>     This manual page was originally based on the src/admin/style/style
>     file from the 4.4BSD-Lite2 release, with frequent updates to
>     reflect the current practice and desire of the FreeBSD project.
>     src/admin/style/style is a codification by the CSRG of the
>     programming style of Ken Thompson and Dennis Ritchie in Version6
>     AT&T UNIX.
>
> So, it seems to be a preference of Ritchie.

It may have been simply long-standing habit rather than preference.
In the early days of C parentheses around return expressions were
required, not optional.  I've been programming in C long enough to
have been influenced by that requirement (and later learned to undo
it).
Technical Details
Message-ID: <86o6cckttt.fsf@linuxsc.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-mail
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> <11brkco$21oj5$1@dont-email.me> <11bs4tj$26daj$1@dont-email.me> <11bs613$26knh$1@dont-email.me> <11bt7ff$2i0ag$1@dont-email.me> <11btm2a$2ojn1$2@kst.eternal-september.org> <11bttrp$2qvg6$1@dont-email.me> <11bu12l$2rgo2$4@kst.eternal-september.org> <11bu3kk$2svh8$1@dont-email.me> <868q3hmie0.fsf@linuxsc.com> <11bu8oi$2up7m$1@dont-email.me> <11bv4jd$37ch9$1@dont-email.me> <11bvsj4$3g32k$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: Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups: comp.lang.c
Subject: Re: .5 against 0.5f
Date: Thu, 29 Oct 2026 15:47:26 -0700
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <86o6cckttt.fsf@linuxsc.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> <11brkco$21oj5$1@dont-email.me> <11bs4tj$26daj$1@dont-email.me> <11bs613$26knh$1@dont-email.me> <11bt7ff$2i0ag$1@dont-email.me> <11btm2a$2ojn1$2@kst.eternal-september.org> <11bttrp$2qvg6$1@dont-email.me> <11bu12l$2rgo2$4@kst.eternal-september.org> <11bu3kk$2svh8$1@dont-email.me> <868q3hmie0.fsf@linuxsc.com> <11bu8oi$2up7m$1@dont-email.me> <11bv4jd$37ch9$1@dont-email.me> <11bvsj4$3g32k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Thu, 29 Oct 2026 22:47:29 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3974705"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18b9628uUzGR0HOizMwTu/6wkXj8eCibpg="; posting-host="a9c9791c9dd02c83b2c564a620bcf3c6"
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:t32QamfW4mqfjps5d1Mpb4qvf70=
	sha1:3S80vN3IzE0jV15mTdkc3UQ852o= sha256:CQO6lI6lzrsjn1V2uGopLhz5YM2C/keYNoePW2b4INg=
	sha1:6uLR/nZIJDZQR3do5bhm6uH71ws= sha256:Xt3ViRbaeNCCN0VeW46M/3ZbzAB/mxHbPrGczgI9MGQ=