🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1257

Re: .5 against 0.5f

#1257
From: David Brown
Date: Mon, 02 Nov 2026 07:50
31 lines
2601 bytes
On 02/11/2026 01:03, Keith Thompson wrote:
> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>> On Sun, 1 Nov 2026 17:15:23 -0500, James Kuyper wrote:
>>> On 2010-08-28, Tony Clough wrote that "One possible problem with C
>>> as compared to other languages like Perl or Shell is that function
>>> calls require parentheses which leads to cluttered code. (But there
>>> are some funny exceptions in the standard library though, eg return
>>> and size_of do not need parentheses)"
>>
>> sizeof does require parentheses if you pass it a type, not for an
>> expression (except for the usual precedence reasons).
>>
>> Not sure why that is ...
> 
> Because if parentheses were not required around the type name, it would
> result in ambiguities.  (I don't have an example off the top of my
> head.)
> 

Perhaps

	x = sizeof(int *) - 1
vs
	x = sizeof int * - 1

?

The later could certainly be misunderstood by someone reading it, but I 
don't know if it would have been ambiguous in the language if 
parentheses had not been required for "sizeof(type)".
Technical Details
Message-ID: <11c9fbp$2lldf$1@dont-email.me>
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> <868q3hmie0.fsf@linuxsc.com> <11bu8oi$2up7m$1@dont-email.me> <11bvqbn$3g0tj$1@dont-email.me> <11c07vf$lhk$1@reader2.panix.com> <11c0fcj$2t865$2@dont-email.me> <11c8dls$2chr0$1@dont-email.me> <11c8i0t$2dr35$1@dont-email.me> <11c8k0t$2e89e$1@kst.eternal-september.org>

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: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: .5 against 0.5f
Date: Mon, 2 Nov 2026 08:50:17 +0100
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <11c9fbp$2lldf$1@dont-email.me>
References: <11bpvs7$1e6kc$2@dont-email.me> <868q3hmie0.fsf@linuxsc.com>
 <11bu8oi$2up7m$1@dont-email.me> <11bvqbn$3g0tj$1@dont-email.me>
 <11c07vf$lhk$1@reader2.panix.com> <11c0fcj$2t865$2@dont-email.me>
 <11c8dls$2chr0$1@dont-email.me> <11c8i0t$2dr35$1@dont-email.me>
 <11c8k0t$2e89e$1@kst.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 02 Nov 2026 07:50:18 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2807215"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19ST/Hlwv8WrX5r1xJ+aqlxLuOI11PVjcg="; posting-host="eac098cfc75e7cb72e1df2e51a145e6a"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:xvqiQqe9HeOr8H+3EAbwhboRV0U= sha256:xEt5AJ/NTdOK+mcVGjA8pq/yNAPQ0ZeMYK2HGRhZmPs=
	sha1:VB0rRNhBNw5AzaKEevxeGbcVsTc= sha256:SRpixDZcY7HO2aGZim1ogTQYaC76D9IxkgnvfjvBdyc=
In-Reply-To: <11c8k0t$2e89e$1@kst.eternal-september.org>
Content-Language: en-GB, nb-NO