Sujet : Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?)
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 04. May 2025, 04:03:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86tt616prh.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Richard Heathfield <
rjh@cpax.org.uk> writes:
On 25/03/2025 11:55, Tim Rentsch wrote:
>
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.
>
But "integer type" is also a problem. 'Integer' is a noun, not an
adjective. To modify the noun 'type' you need an adjective that means
of, pertaining to, or being an integer'. The only available candidate
is 'integral'.
Using a noun as a modifier to another noun is a perfectly normal
English construction. It's called a noun adjunct. "Chicken soup"
is an example. See
https://en.wikipedia.org/Noun_adjunctFurthermore, there are other noun-as-modifier constructions in the
original C standard. The C89/C90 standard has "function types",
"character types", "signed integer types", "unsigned integer
types", "integer constants", and "integer character constants", to
give a few examples. In fact the C standard is rife with noun-noun
phrases: "execution environment", "storage boundaries", "byte
address", "bit representation", "language elements", "program
construct", "character set" -- and that's just on page 2.
I'll cheerfully accept "integer type" because, though clumsy, it's
standardese. But if we're using English it's wrong to reject "integral
type"; 'adjective noun' is far closer to the spirit of the English
language than 'noun noun'.
Both are perfectly fine, as far as what kind of constructions are
allowed in English. The reason "integral types" is a worse choice
than "integer types" is that "integral types" has a different
meaning, and in particular an inappropriate meaning. The adjective
"integral" refers to the /value/ of a number, regardless of what
number system it is in. The noun "integer" used as a modifier refers
to the number system. An integer number always has an integral
value, but real numbers or complex numbers can have integral values
without being integer numbers.
At least until such time as the backroom
boffins come up with a better adjective for 'of, pertaining to, or
being an integer', I stand with a foot planted firmly within each
camp.
One word being an adjective is a red herring. Using "integer types"
is better both because it is more consistent with other parts of the
C standard and because the meaning is crisper due to there being
less ambiguity as to what is meant.