🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1156

Re: .5 against 0.5f

#1156
From: David Brown
Date: Fri, 30 Oct 2026 08:11
74 lines
5068 bytes
On 30/10/2026 04:38, Janis Papanagnou wrote:
> On 2026-10-30 00:56, Keith Thompson wrote:
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>>> Note: my argumentation is based on questioning the existence of 'F'.
>>>> So I'd appreciate to hear of any enlightening application cases, ones
>>>> that would be impossible when 'F' in literals wouldn't be present.
>>>
>>> In C the word is constants, not literals.
>>
>> For now.  In the latest C2y draft, they're called literals.
>>
>> Proposal:       https://www.open-std.org/jtc1/sc22/wg14/www/docs/ 
>> n3189.htm
>> Draft standard: https://www.open-std.org/jtc1/sc22/wg14/www/docs/ 
>> n3998.pdf
>>
>> (You've said before that you dislike this change.)
>>
>> In any case, the term "literal" is unambiguous, even if it's not
>> currently used by the C standard.
> 
> Thanks for answering him. (As I'm yet again ignoring him I wouldn't
> have noticed his statement.)
> 
> For other readers I remind that I'm not necessarily using C-standard
> terms if there's terms common in CS existing that either appear more
> appropriately describing things, or if I'm generalizing facts beyond
> "C".

The preference should be to use the C standard terms in this group - or 
to add brief comments for clarity.  (Sometimes it is also worth adding 
comments for clarity even when using C standard terms.)  The C standard 
uses terms like "object" and "byte" in a way that is unusual in the 
wider scope of computer science.  But sometimes computer science courses 
use different terms, as do different programming languages and different 
parts of the world, and things change over time - often there is no 
single "standard CS" term, and often there is no fixed definition of a 
term commonly used in computer science.  Many of the terms used in the C 
standard have the strong advantage of having specific definitions given 
in the standard itself.

If in doubt, being a little extra explicit is better than being 
misunderstood!

In the particular case of "constant", I think the root issue is that the 
word is overused.  "integer constant" and "integer constant expression" 
are significantly different things in the C standards - it would seem 
logical to think that an "integer constant expression" evaluates to an 
"integer constant", but that is not the case.  "const int x = 1;" does 
not define an "integer constant" or an "integer constant expression", 
while "constexpr int y = 1;" makes "y" and "integer constant expression" 
but not an "integer constant".  Meanwhile, "Hello, world!" is a "string 
literal", not a "string constant".

When C was young and fresh, there were far fewer constant things - and 
the terminology made sense.  As more constant things (like "const" and 
then "constexpr") were added, it became less clear.  C++ has called 123 
an "integer literal" for ages, and it makes sense for C to follow suit.

I doubt if this is the start of a habit or pattern, however.


> 
> It's noteworthy that the new C-standard draft is using that term;[*]
> I didn't know that, so also thanks also for that information.
> 
> Janis
> 
> [*] May we interpret that fact as C-standard terms might eventually
> converge to a more commonly accepted "beyond C standard" terminology?
> (I expect no answer. - It was just some pondering aloud.)
> 
Technical Details
Message-ID: <11c1jg6$2kc6$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> <11bqnvh$1np7s$1@dont-email.me> <11br5td$1to7l$1@dont-email.me> <11br792$1u7e5$1@dont-email.me> <11brgqf$21170$2@dont-email.me> <11brir0$1uh9q$4@kst.eternal-september.org> <11bt4ua$139ta$8@dont-email.me> <11btlrl$2ojn1$1@kst.eternal-september.org> <11btv9c$139ta$12@dont-email.me> <86wlr0kzqc.fsf@linuxsc.com> <11c0mfg$3pmvb$4@kst.eternal-september.org> <11c13eq$2t866$6@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: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: .5 against 0.5f
Date: Fri, 30 Oct 2026 09:11:50 +0100
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <11c1jg6$2kc6$1@dont-email.me>
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> <11brir0$1uh9q$4@kst.eternal-september.org>
 <11bt4ua$139ta$8@dont-email.me> <11btlrl$2ojn1$1@kst.eternal-september.org>
 <11btv9c$139ta$12@dont-email.me> <86wlr0kzqc.fsf@linuxsc.com>
 <11c0mfg$3pmvb$4@kst.eternal-september.org> <11c13eq$2t866$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Oct 2026 08:11:51 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="86406"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/61kT9rfZ4rALXZD6lV3UuLY3u9WJd59g="; posting-host="005feb7eca873ed1ea966324157898e1"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rvusB/Xbp8CXlh3ka6k+YbnMs8Y= sha256:CYsHSvGbtNi6u4+ocXWvJJslxvMvI40QsCL4bF35nlI=
	sha1:64QYrW2+sW0Smyfs+dJdJ4NnnUE= sha256:+mbNylUi6P2ljplMKAWj+jKetlvcP7AgO2fDH9mmHGg=
Content-Language: en-GB, nb-NO
In-Reply-To: <11c13eq$2t866$6@dont-email.me>