| Deutsch English Français Italiano |
|
<86frj1jpem.fsf@linuxsc.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: Tim Rentsch <tr.17687@z991.linuxsc.com> Newsgroups: comp.lang.c Subject: Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Date: Tue, 25 Mar 2025 04:55:13 -0700 Organization: A noiseless patient Spider Lines: 85 Message-ID: <86frj1jpem.fsf@linuxsc.com> References: <vrd77d$3nvtf$2@dont-email.me> <868qp1ra5f.fsf@linuxsc.com> <vrdhok$47cb$2@dont-email.me> <20250319115550.0000676f@yahoo.com> <vreuj1$1asii$4@dont-email.me> <vreve4$19klp$2@dont-email.me> <20250319201903.00005452@yahoo.com> <86r02roqdq.fsf@linuxsc.com> <vrh1br$35029$2@dont-email.me> <LRUCP.2$541.0@fx47.iad> <vrh71t$3be42$1@dont-email.me> <KFVCP.594649$SZca.498578@fx13.iad> <vrhb77$3frk8$1@dont-email.me> <vrru8f$174q6$1@dont-email.me> <86o6xpk8sn.fsf@linuxsc.com> <vrtmu4$2s1q2$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Tue, 25 Mar 2025 12:55:23 +0100 (CET) Injection-Info: dont-email.me; posting-host="dc97818a680e22f6747ff94516233a05"; logging-data="3440865"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WZu38mnAC8ZMX7wKA73lCRrux549+Ma8=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:1yUkXyH4xuDtlLSfvIBG4QIKQmQ= sha1:HmuHdgWdNpZnZAmjQEEUr/tdaek= Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes: > On 25.03.2025 05:56, Tim Rentsch wrote: > >> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes: >> >> [...] >> >>> When I started with "C" or C++ there were not only 8-bit >>> multiples defined for the integral types; [...] >> >> In C the correct phrase is integer types, not integral types. > > My apologies if I'm using language independent terms. The problem is that what was written used the word "integral" incorrectly. > I'm confident, though, that most people (obviously you as well) > understood the term. It is likely that I would understand what was meant if someone said they wanted to "pay me a complement", but that doesn't mean the usage is correct English. "Complement" and "compliment" don't mean the same thing. > I understand that the "C" standard may have consistently been using > another naming. - Frankly, I'm a bit puzzled that general (language > independent) terms are considered "incorrect" by the audience here. The words "integer" and "integral" are not specific to programming languages. They have well-established meanings in English, and mean different things. People who think "integer" and "integral" can be used interchangeably are illiterate, at least with respect to this one aspect of the English language. >> The constant 3.0, for example, has an integral value, but it >> does not have an integer value. > > The literal "3.0" is usually not representing the value of an > integral [data] type like 'int'.[*] In C the word is constant, not literal; literals are something else. Again the word "integral" is being used incorrectly. The type int is an integer data type. If a real number r has a value not equal to zero, then r/r has an integral value, but it is still a real number, and not an integer. > (You are speaking about "integral value" here, I was illustrating a correct usage of the word "integral", and also showing the distinction between the adjective "integral" and the adjective "integer". > I was speaking about the "integral [data] types". Not sure why > you shifted the goalpost.) I gave an example to illustrate correct usage. If someone thinks what I said was shifting some sort of goalpost then they didn't understand the point I was making. > [*] For languages that don't have a distinguished integral numeric > data type, or that do implicit coercion, things may be different of > course. One more time: it is INTEGER data type, not INTEGRAL data type. Certainly it is possible to imagine a floating-point representation that was constrained in some way so that any fractional part is always zero, but also has NaNs, and such a representation could plausibly be called an INTEGRAL data type. Another example is a fixed-point data type that has a scale factor of 1024 (so only multiples of 1024 are representable): such a data type has INTEGRAL values, but isn't suitable for holding INTEGER values. The important point here is not that C defines these two terms differently, and indeed it doesn't define them at all, but that the C standard correctly uses the English word "integer", and does not make the mistake of incorrectly using the different English word "integral", when "integer data types" are being discussed. (The C90 standard mistakenly used "integral", but that mistake was corrected in C99.)