| Deutsch English Français Italiano |
|
<vruid4$3iuvq$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> 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 16:33:56 +0100 Organization: A noiseless patient Spider Lines: 87 Message-ID: <vruid4$3iuvq$1@dont-email.me> 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> <20250325011327.41@kylheku.com> <20250325131110.000056bd@yahoo.com> <86bjtpjp22.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 25 Mar 2025 16:34:01 +0100 (CET) Injection-Info: dont-email.me; posting-host="bf9dcec6eb92cc3208b4c8fb8b5d2bb0"; logging-data="3767290"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/npb3n879qbw6rbDsQRl4sCxhmNZmQNpE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cancel-Lock: sha1:BBElJAr4fQlsKl5/gw8j2BFMl1A= In-Reply-To: <86bjtpjp22.fsf@linuxsc.com> Content-Language: en-GB Bytes: 5577 On 25/03/2025 13:02, Tim Rentsch wrote: > Michael S <already5chosen@yahoo.com> writes: > >> On Tue, 25 Mar 2025 08:39:04 -0000 (UTC) >> Kaz Kylheku <643-408-1753@kylheku.com> wrote: >> >>> On 2025-03-25, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> >>> wrote: >>> >>>> 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. I'm confident, >>>> though, that most people (obviously you as well) understood the >>>> term. >>> >>> You are 100% correct. You made it clear that you're referring >>> to a time /when you started with C/. I remember from past discussions >>> that this was sufficiently long ago that it was ISO C90 or ANSI C, >>> if not earlier. >>> >>> In ISO 9899:1990, we have this: >>> >>> 6.1.2.5 Types >>> >>> [...] >>> >>> "The type char, the signed and unsigned integer types. and the >>> enumerated types are collectively called integral types." >>> ^^^^^^^^ >>> >>> The integral types were renamed between C90 and C99. However, >>> "integral types" remains part of C history. C90 is a still valid, >>> historic and historically significant dialect of C. >>> >>> Even today, it is misleading to say that "integral types" >>> is an incorrect way to talk about C. It's a terminology that >>> has been formally superseded since C90. However, it is a term >>> used in computer science and mathematics, and fine for informal >>> discussions that don't revolve around language-lawyering. >>> >>> The word has two pronunciations in English. When the emphasis is on >>> the first syllalble: IN-tgrl, it is a noun which refers to the >>> opposite of a calculus derivative. The integral of x^2 from 0 to 1, >>> etc. in-TE-gral is an adjective, which is is a common words---it's an >>> integral part of everyday English, meaning indivisible from. In math >>> and CS it is used for indicating that some quantity is in Z. >> >> Wouldn't the term 'whole numbers' be preferred in everyday English? > > "Whole numbers" are all non-negative. > > "Integers" include values less than zero. "Everyday English" does not cover negative numbers at all - in "everyday English", "integer" and "whole number" are basically synonymous and mean 1, 2, 3, etc. But in standard mathematical usage, "whole numbers" are non-negative, while "integers" include negative numbers. (There is no solid agreement about whether 0 is a "whole number" or not.) And I think it is reasonable to expect that people using functions like "modf" are familiar with the mathematical usage, so the term "integer" - or the adjective variant "integral" - are fine. Whether the word "integer" or "integral" is most suitable in a particular context, will depend on common usage in related contexts, and probably also vary from place to place (such as between common US usage and common British usage). The word "integral" is not used as a noun (in the sense of "whole number"), but both words can be used as adjectives. So "integer type" and "integral type" would work fine - but "integer type" is the more common usage in computer programming. Similarly, it would be fine for the C standards to say "The modf functions break the argument value into /integer/ and fractional parts" rather than "/integral/ and fractional parts". However, the word "integral" is perhaps better here because it is distinct from the use of "integer" as a type, to reduce confusion.