On 20/03/2025 14:32, Scott Lurndal wrote:
bart <[email protected]> writes:
On 20/03/2025 13:36, Scott Lurndal wrote:then it's surprisingly rare in source code.
Long is useless, because Microsoft made the mistake of defining
'long' as 32-bits on 64-bit architectures, while unix and linux
define it as 64-bits.
Unix and Linux define it as 32 bits on 32-bit architectures and 64 bits
on 64-bit ones.
That's what I said. Thanks for the confirmation. It doesn't change
the fact that Microsoft didn't define long as 64-bit on 64-bit
architectures,
creating incompatibilities that didn't exist in the 32-bit world
between the two dominant operating systems.
Remainder of bart's typical windows-centric complaints elided.
But your typical anti-Microsoft remarks are fine? Since you called it a 'mistake' to keep 'long' the same between 32/64-bit machines, even
though both OSes kept 'int' the same.
[...]
On 20.03.2025 16:11, bart wrote:
On 20/03/2025 14:32, Scott Lurndal wrote:
bart <[email protected]> writes:
On 20/03/2025 13:36, Scott Lurndal wrote:then it's surprisingly rare in source code.
Long is useless, because Microsoft made the mistake of defining
'long' as 32-bits on 64-bit architectures, while unix and linux
define it as 64-bits.
Unix and Linux define it as 32 bits on 32-bit architectures and 64 bits >>>> on 64-bit ones.
That's what I said. Thanks for the confirmation. It doesn't change
the fact that Microsoft didn't define long as 64-bit on 64-bit
architectures,
creating incompatibilities that didn't exist in the 32-bit world
between the two dominant operating systems.
Remainder of bart's typical windows-centric complaints elided.
But your typical anti-Microsoft remarks are fine? Since you called it a
'mistake' to keep 'long' the same between 32/64-bit machines, even
though both OSes kept 'int' the same.
Many things (more or less related) come to my mind when reading that.
Of primary interest here is certainly what the "C" standard defines.
It's not that enlightening (IMO) what Microsoft did/does (or Linux);
these are just two [common contemporary] examples.
When I started with "C" or C++ there were not only 8-bit multiples
defined for the integral types; there were 9 bit or 36 bit entities
on some machines. And a 'int' type could be 16 or 32 bit (or 36 bit);
'int' reflected (sort of) the "machine register size". And the other
types were woven around; 'short' not larger than 'int', 'long' not
smaller than 'int'. Optimization considerations made it possible to
have just a single actual size for all numeric integral types' sizes.
Unless you are focused with your development on just a single machine >architecture you may choose the appropriate types with their specific
"C" language names.
In our application cases we needed certainty about actual sizes, so
(as many others did) we introduced our own types; like the entities
that you find now defined in "types.h". (Back these days there was
no "types.h" available.)
Janis Papanagnou <[email protected]> writes:
On 20.03.2025 16:11, bart wrote:
On 20/03/2025 14:32, Scott Lurndal wrote:
bart <[email protected]> writes:
On 20/03/2025 13:36, Scott Lurndal wrote:then it's surprisingly rare in source code.
Long is useless, because Microsoft made the mistake of defining
'long' as 32-bits on 64-bit architectures, while unix and linux
define it as 64-bits.
Unix and Linux define it as 32 bits on 32-bit architectures and 64 bits >>>>> on 64-bit ones.
That's what I said. Thanks for the confirmation. It doesn't change
the fact that Microsoft didn't define long as 64-bit on 64-bit
architectures,
creating incompatibilities that didn't exist in the 32-bit world
between the two dominant operating systems.
Remainder of bart's typical windows-centric complaints elided.
But your typical anti-Microsoft remarks are fine? Since you called it a
'mistake' to keep 'long' the same between 32/64-bit machines, even
though both OSes kept 'int' the same.
Many things (more or less related) come to my mind when reading that.
Of primary interest here is certainly what the "C" standard defines.
It's not that enlightening (IMO) what Microsoft did/does (or Linux);
these are just two [common contemporary] examples.
When I started with "C" or C++ there were not only 8-bit multiples
defined for the integral types; there were 9 bit or 36 bit entities
on some machines. And a 'int' type could be 16 or 32 bit (or 36 bit);
'int' reflected (sort of) the "machine register size". And the other
types were woven around; 'short' not larger than 'int', 'long' not
smaller than 'int'. Optimization considerations made it possible to
have just a single actual size for all numeric integral types' sizes.
Unless you are focused with your development on just a single machine
architecture you may choose the appropriate types with their specific
"C" language names.
In our application cases we needed certainty about actual sizes, so
(as many others did) we introduced our own types; like the entities
that you find now defined in "types.h". (Back these days there was
no "types.h" available.)
When would that have been?
/work/reference/usl/unix/v7/usr/include/sys/types.h
stdint.h came much later.
v7 types.h:
typedef long daddr_t; /* disk address */
typedef char * caddr_t; /* core address */
typedef unsigned int ino_t; /* i-node number */
typedef long time_t; /* a time */
typedef int label_t[6]; /* program status */
typedef int dev_t; /* device code */
typedef long off_t; /* offset in file */
/* selectors and constructor for device code */
#define major(x) (int)(((unsigned)x>>8))
#define minor(x) (int)(x&0377)
#define makedev(x,y) (dev_t)((x)<<8|(y))
When I started with "C" or C++ there were not only 8-bit
multiples defined for the integral types; [...]
Janis Papanagnou <[email protected]> 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.
The constant 3.0, for example, has an integral value, but it
does not have an integer value.
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
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 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'.[*]
(You are speaking about "integral value" here, I was speaking about
the "integral [data] types". Not sure why you shifted the goalpost.)
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
On 2025-03-25, Janis Papanagnou <[email protected]> wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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. [...]
On 2025-03-25, Janis Papanagnou <[email protected]>
wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
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 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'.[*]
(You are speaking about "integral value" here,
I was speaking about the "integral [data] types". Not sure why
you shifted the goalpost.)
[*] For languages that don't have a distinguished integral numeric
data type, or that do implicit coercion, things may be different of
course.
On Tue, 25 Mar 2025 08:39:04 -0000 (UTC)
Kaz Kylheku <[email protected]> wrote:
On 2025-03-25, Janis Papanagnou <[email protected]>
wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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?
Michael S <[email protected]> writes:
On Tue, 25 Mar 2025 08:39:04 -0000 (UTC)
Kaz Kylheku <[email protected]> wrote:
On 2025-03-25, Janis Papanagnou <[email protected]>
wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
Wouldn't the term 'whole numbers' be preferred in everyday English?
Michael S <[email protected]> writes:
On Tue, 25 Mar 2025 08:39:04 -0000 (UTC)
Kaz Kylheku <[email protected]> wrote:
On 2025-03-25, Janis Papanagnou <[email protected]>
wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
On Tue, 25 Mar 2025 05:02:45 -0700<snip>
Tim Rentsch <[email protected]> wrote:
Michael S <[email protected]> writes:
Wouldn't the term 'whole numbers' be preferred in everyday English?
"Whole numbers" are all non-negative.
"Integers" include values less than zero.
Thank you.
Sounds like English everyday use differs from two other languages that
I know relatively well in both of which "whole" numbers include
negatives.
On 2025-03-25, Michael S <[email protected]> wrote:
[re: "integral"]
Wouldn't the term 'whole numbers' be preferred in everyday English?
The everyday adjective "integral" is not used in a mathematical
sense of denoting integers; e.g. "vitamin C is an integral part
of a human diet" doesn't mean "whole number part of a human diet".
Sure, the adjective "whole" serves informally as "integral";
as in 2 3/4 has a whole part of 2, and a fractional part of 3/4.
On 25/03/2025 08:45, Janis Papanagnou wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
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.
Most of the audience here, I believe, are usually happy when it is
obvious what you mean. But many here can be very pedantic - that's a
very useful trait in its place, and annoying when out of place.
If you stray /too/ far from the C standard terminology, [...]
[...]
Wouldn't the term 'whole numbers' be preferred in everyday English?
On 25/03/2025 13:02, Tim Rentsch wrote:
Michael S <[email protected]> writes:
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.) [...]
Thank you.
Sounds like English everyday use differs from two other languages that
I know relatively well in both of which "whole" numbers include
negatives.
On Tue, 25 Mar 2025 05:02:45 -0700
Tim Rentsch <[email protected]> wrote:
Michael S <[email protected]> writes:
On Tue, 25 Mar 2025 08:39:04 -0000 (UTC)
Kaz Kylheku <[email protected]> wrote:
On 2025-03-25, Janis Papanagnou <[email protected]>
wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
Sounds like English everyday use differs from two other languages that
I know relatively well in both of which "whole" numbers include
negatives.
On Tue, 25 Mar 2025 05:02:45 -0700[...]
Tim Rentsch <[email protected]> wrote:
Michael S <[email protected]> writes:
Wouldn't the term 'whole numbers' be preferred in everyday English?
"Whole numbers" are all non-negative.
"Integers" include values less than zero.
Sounds like English everyday use differs from two other languages that
I know relatively well in both of which "whole" numbers include
negatives.
Janis Papanagnou <[email protected]> writes:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
On 2025-03-25, Richard Heathfield <[email protected]> wrote:
On 25/03/2025 11:55, Tim Rentsch wrote:
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'.
How can you post that from of the proximity of the birth place
of the English language?
The English language features noun phrases (NPs), and in that
category are found compound nouns. Compound nouns have a head. The head
is always the rightmost element of the sequence. The other nouns modify
the head as if they were adjectives.
On 25/03/2025 11:55, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> writes:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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'.
I'll cheerfully accept "integer type" because, though clumsy,
Janis Papanagnou <[email protected]> writes:
On 25.03.2025 12:11, Michael S wrote:
[...]
Wouldn't the term 'whole numbers' be preferred in everyday English?
If I speak about numbers I name them so; "numbers", "whole numbers",
"integer numbers", "real numbers" (not "floating point numbers").
Sometimes, depending on context, I use the term "scalar". When I'm
speaking about "integral types" I don't restrict that term to numbers.
Real numbers and floating-point numbers have different meanings, both in
C and in general.
In C, both integer and floating-point types are "real" (as opposed
to complex or imaginary), though I consider this use of "real" to
be a bit obscure. [...]
Real numbers and floating-point numbers have different meanings, both in
C and in general.
Janis Papanagnou <[email protected]> writes:
[...]
For me there's an additional
practical fact to keep in mind; that what we call "Ganzzahl" (whole
numbers) isn't corresponding to what "whole number" means in English,
What "whole numbers" means in English doesn't necessarily correspond to
what "whole numbers" means in English.
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
On 22.03.2025 15:07, Waldek Hebisch wrote:
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one* multiplication of 2N bit numbers? - Could you please explain that (by
an example, or could you provide a reference)?
(The reason for my question is that for integer divisions of length N
an old DSP I used required besides shifts effectively N subtractions
to create the result and modulus; it didn't use any multiplications.)
On 22.03.2025 15:07, Waldek Hebisch wrote:I think he meant "one needs 2N-bit multiplication". "one" is a pronoun
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one* multiplication of 2N bit numbers?
On 25.03.2025 09:08, David Brown wrote:
On 25/03/2025 08:45, Janis Papanagnou wrote:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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.
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.
Most of the audience here, I believe, are usually happy when it is
obvious what you mean. But many here can be very pedantic - that's a
very useful trait in its place, and annoying when out of place.
One thing I dislike [in this newsgroup] (but have to accept of course)
is that even posts that have a simple, isolated topic become tapeworms
and often contain boring ping-pong discussions.
Pedantism is one thing
that fosters the evolution of such CLC-typical threads. I think it's
fine if we are speaking about standards, or specific "C" instances.
But in cases where it's very obviously not specifically related to "C"
I perceive such distracting responses to be more like trollish than
useful.
And in cases where the used terms are clearly understandable (even to "C"-only nerds) I'd appreciate if we could focus on the topic.
If you stray /too/ far from the C standard terminology, [...]
My strong opinion is that the more general CS topics are best not
discussed in specific terminology. (I'm sure that mileages vary.)
On 25.03.2025 16:33, David Brown wrote:
On 25/03/2025 13:02, Tim Rentsch wrote:
Michael S <[email protected]> writes:
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.) [...]
This all is interesting. - As a non-native English speaker that's not obvious. - Where I live we have learned
ℕ (called "natural numbers"): 1, 2, ...
ℕ with an index 0 (positive/non-negative whole numbers): 0, 1, 2, ...
ℤ (integer numbers, called "whole numbers"): ..., -1, 0, 1, 2, ...
On Tue, 25 Mar 2025 05:02:45 -0700
Tim Rentsch <[email protected]> wrote:
Michael S <[email protected]> writes:
Wouldn't the term 'whole numbers' be preferred in everyday English?
"Whole numbers" are all non-negative.
"Integers" include values less than zero.
Thank you.
Sounds like English everyday use differs from two other languages that
I know relatively well in both of which "whole" numbers include
negatives.
David Brown <[email protected]> writes:
[...]
"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.
Perhaps I don't speak everyday English.
Most people probably rarely use the word "integer".
When they do,
if they use it correctly, they use it to refer to the set of numbers
with no fractional part, which can be positive, zero, or negative.
I've never heard the word "integer" used in a way that excludes
negative numbers.
The way I was taught in elementary school:
The integers are ..., -2, -1, 0, 1, 2 ...
The natural numbers are 1, 2, ...
The whole numbers are 0, 1, 2, ...
There isn't universal agreement on whether the natural and/or whole
numbers include 0. Ada, for example, has a subtype Natural whose lower
bound is 0 (Positive starts at 1), which was very slightly jarring when
I first encountered it.
On 3/25/25 19:38, Keith Thompson wrote:
Janis Papanagnou <[email protected]> writes:
[...]
For me there's an additional
practical fact to keep in mind; that what we call "Ganzzahl" (whole
numbers) isn't corresponding to what "whole number" means in English,
What "whole numbers" means in English doesn't necessarily correspond to
what "whole numbers" means in English.
According to the Wikipedia article on integers, "The whole numbers were synonymous with the integers up until the early 1950s In the late 1950s,
as part of the New Math movement, American elementary school teachers
began teaching that whole numbers referred to the natural numbers,
excluding negative numbers, while integer included the negative numbers.
The whole numbers remain ambiguous to the present day."
I was born just in time to be taught the New Math in school.
On 25/03/2025 22:36, Kaz Kylheku wrote:
On 2025-03-25, Richard Heathfield <[email protected]> wrote:
On 25/03/2025 11:55, Tim Rentsch wrote:
<snip>
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'.
How can you post that from of the proximity of the birth place
of the English language?
The English language features noun phrases (NPs), and in that
category are found compound nouns. Compound nouns have a head. The head
is always the rightmost element of the sequence. The other nouns modify
the head as if they were adjectives.
But 'integral' modifies 'type' because it /is/ an adjective. Hard to see
how a charge of 'incorrect' can be justified.
On 3/25/25 21:04, Janis Papanagnou wrote:
On 22.03.2025 15:07, Waldek Hebisch wrote:I think he meant "one needs 2N-bit multiplication". "one" is a pronoun
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one*
multiplication of 2N bit numbers?
in this context, not a number.
David Brown <[email protected]> writes:
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much
you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
So if you ask someone random "Do you know what an integer is?", a
likely response will be "That's a whole number, isn't it? Like 1, 2
or 3 - not something like a half."
I suspect that most people who would use the word "integer" without
being prompted would use it correctly.
On 3/25/25 21:04, Janis Papanagnou wrote:
On 22.03.2025 15:07, Waldek Hebisch wrote:I think he meant "one needs 2N-bit multiplication". "one" is a pronoun
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one*
multiplication of 2N bit numbers?
in this context, not a number.
[ substituting a division by multiplication (and some primitives) ]
Roughly speaking, when you want division of "y" by a fixed - i.e.,
constant value known at compile time - number "x", you can do it by pre-calculating z = 2^n / x and then you implement "y / x" by "y * z /
2^n". (There's also some stuff to handle correct rounding, especially
with signed types.)
[...]
Janis Papanagnou <[email protected]> wrote:
On 22.03.2025 15:07, Waldek Hebisch wrote:
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one*
multiplication of 2N bit numbers? - Could you please explain that (by
an example, or could you provide a reference)?
One multiplications with 2N bit result + few other operations
like shifts and additions. Consider for example:
unsigned int
divv(unsigned int a) {
return a/1234567;
}
My gcc-12 at -O generates the following assembly code:
divv:
.LFB0:
.cfi_startproc
movl %edi, %eax
movl $3000869427, %edx
imulq %rdx, %rax
shrq $32, %rax
subl %eax, %edi
shrl %edi
addl %edi, %eax
shrl $20, %eax
ret
So 1 multiplication, 3 shifts, subtraction and addtion. When
more bits of multiplication are available one can use smaller
number of extra operations. For example, when I change
function above so that argument is 16-bit and divisor is
12345, the code is:
divv:
.LFB0:
.cfi_startproc
movzwl %di, %eax
imull $43489, %eax, %eax
shrl $29, %eax
ret
So just 1 multiplication and 1 shift.
The idea beside this is quite simple: instead of division we
multiply by reciprocal.
Reciprocal is represented in fixed
point aritihemtic (so normally there is at least one shift to get
binary point in right place). Since divisor is fixed reciprocal can
be precomputed. This works best when there is enough accuracy,
otherwise one needs to add extra steps. Working out how
many bits of accuracy are needed is a bit tricky, in particular
by adding extra operations one can lower needed accuracy.
(The reason for my question is that for integer divisions of length N
an old DSP I used required besides shifts effectively N subtractions
to create the result and modulus; it didn't use any multiplications.)
Method above is good when you have fast and wide multiplier (compared
to your numbers). Also there is cost of precomputation,
to gain divisor must be fixed or at least change slowly.
If you have varying divisor then one can use Newton method
(IIUC this is what modern CPU-s use). Shifts and subtractions
are good when you do not have fast multiplier.
On 26/03/2025 00:55, James Kuyper wrote:
On 3/25/25 19:38, Keith Thompson wrote:
Janis Papanagnou <[email protected]> writes:
[...]
For me there's an
additional practical fact to keep in mind; that what we call
"Ganzzahl" (whole numbers) isn't corresponding to what "whole
number" means in English,
What "whole numbers" means in English doesn't necessarily
correspond to what "whole numbers" means in English.
According to the Wikipedia article on integers, "The whole numbers
were synonymous with the integers up until the early 1950s In the
late 1950s, as part of the New Math movement, American elementary
school teachers began teaching that whole numbers referred to the
natural numbers, excluding negative numbers, while integer included
the negative numbers. The whole numbers remain ambiguous to the
present day."
That's an interesting historical point, thanks.
It's also important in such discussions to remember that the USA
doesn't have a monopoly on the English language, or maths - they
can't even spell "maths" correctly :-)
So "everyday English" usage will vary in time and space, as will the definitions people were taught in school (which most "normal" folk
will have long forgotten anyway).
(It is entirely reasonable that the "everyday English" usage in the C standards be based on US American usage - even though #include
<math.h> always makes me feel like I'm speaking with a lisp.)
I was born just in time to be taught the New Math in school.
These days, of course, kids don't learn about any of this - they just
learn how to ask ChatGPT about it from their iPad.
But your school in UK taught you the same meaning of 'whole numbers' as James's school in US.
Sure. But most people have forgotten such details long ago - negative numbers are not part of daily life (except as an indicator of how much
you owe the bank...). [...]
On 26/03/2025 10:59, Keith Thompson wrote:
David Brown <[email protected]> writes:
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much
you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
They do. But they understand it as "I owe the bank $100" - they don't
view it as "I have -$100 in my bank account". [...]
Even in C (in a desperate attempt to bring us back on topic for the
group), there are no negative integer constants - merely positive
integer constants with a unary minus operator applied.
James Kuyper <[email protected]> wrote:
On 3/25/25 21:04, Janis Papanagnou wrote:
On 22.03.2025 15:07, Waldek Hebisch wrote:I think he meant "one needs 2N-bit multiplication". "one" is a pronoun
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one*
multiplication of 2N bit numbers?
in this context, not a number.
Yes, of course "one" in my text above is a pronoun. I do not know
how Janis guessed one multiplication, but it is correct guess.
[...]
On Wed, 26 Mar 2025 14:45:50 +0000
Richard Heathfield <[email protected]> wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole
numbers' as James's school in US.
What makes you think so?
It seems, he said it himself in one of replies.
Mine certainly didn't.
But you are significantly older than David. Not sure about James.
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole
numbers' as James's school in US.
What makes you think so?
Mine certainly didn't.
This thread was
the first time in my life I've ever encountered the rather
peculiar notion that whole numbers exclude negatives. Now that I
/have/ encountered that notion, I see no compelling reason to
endorse it.
For me the important part about whole numbers is not their sign
but the part that makes them whole --- the absence of a remainder
after division by 1.
On 26.03.2025 12:33, David Brown wrote:
Even in C (in a desperate attempt to bring us back on topic for the
group), there are no negative integer constants - merely positive
integer constants with a unary minus operator applied.
Is that so? (Harmlessly asking.) - I mean, if I write int x = -5;
does it matter (in "C") whether its parsed as <integer number> or
<negation> <positive number> ?
I faintly recall a discussion, I think in context of exponentiation.
But I don't want to (re-)open a can of words...
On Wed, 26 Mar 2025 14:45:50 +0000
Richard Heathfield <[email protected]> wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole
numbers' as James's school in US.
What makes you think so?
It seems, he said it himself in one of replies.
Mine certainly didn't.
But you are significantly older than David. Not sure about James.
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole numbers' as
James's school in US.
What makes you think so? Mine certainly didn't. This thread was the
first time in my life I've ever encountered the rather peculiar notion
that whole numbers exclude negatives. Now that I /have/ encountered that notion, I see no compelling reason to endorse it.
For me the important part about whole numbers is not their sign but the
part that makes them whole --- the absence of a remainder after division
by 1.
On Wed, 26 Mar 2025 10:00:40 +0100
David Brown <[email protected]> wrote:
On 26/03/2025 00:55, James Kuyper wrote:
On 3/25/25 19:38, Keith Thompson wrote:
Janis Papanagnou <[email protected]> writes:
[...]
For me there's an
additional practical fact to keep in mind; that what we call
"Ganzzahl" (whole numbers) isn't corresponding to what "whole
number" means in English,
What "whole numbers" means in English doesn't necessarily
correspond to what "whole numbers" means in English.
According to the Wikipedia article on integers, "The whole numbers
were synonymous with the integers up until the early 1950s In the
late 1950s, as part of the New Math movement, American elementary
school teachers began teaching that whole numbers referred to the
natural numbers, excluding negative numbers, while integer included
the negative numbers. The whole numbers remain ambiguous to the
present day."
That's an interesting historical point, thanks.
It's also important in such discussions to remember that the USA
doesn't have a monopoly on the English language, or maths - they
can't even spell "maths" correctly :-)
So "everyday English" usage will vary in time and space, as will the
definitions people were taught in school (which most "normal" folk
will have long forgotten anyway).
But your school in UK taught you the same meaning of 'whole numbers' as James's school in US.
So, it seems, US and UK had common 'New Math'
movement that supposedly didn't affect majority of non-English-speaking countries.
On 26.03.2025 12:40, David Brown wrote:
[ substituting a division by multiplication (and some primitives) ]
Roughly speaking, when you want division of "y" by a fixed - i.e.,
constant value known at compile time - number "x", you can do it by
pre-calculating z = 2^n / x and then you implement "y / x" by "y * z /
2^n". (There's also some stuff to handle correct rounding, especially
with signed types.)
Thanks for the terse explanation; the formulas helped me to detect
that the constants in Waldek's assembler code are the pre-computed reciprocals.
First I thought that there's a trick to avoid division of non-const expressions.
On Wed, 26 Mar 2025 14:45:50 +0000
Richard Heathfield <[email protected]> wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole
numbers' as James's school in US.
What makes you think so?
It seems, he said it himself in one of replies.
Mine certainly didn't.
But you are significantly older than David. Not sure about James.
David Brown <[email protected]> writes:
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much
you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
On 26/03/2025 15:45, Richard Heathfield wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole
numbers' as
James's school in US.
What makes you think so? Mine certainly didn't. This thread was
the first time in my life I've ever encountered the rather
peculiar notion that whole numbers exclude negatives. Now that
I /have/ encountered that notion, I see no compelling reason to
endorse it.
Yes, but didn't your school education predate Georg Cantor and
the development of set theory? :-)
On 26/03/2025 16:16, Michael S wrote:
On Wed, 26 Mar 2025 14:45:50 +0000
Richard Heathfield <[email protected]> wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole
numbers' as James's school in US.
What makes you think so?
It seems, he said it himself in one of replies.
Now I am doubting myself. Still, I am pretty sure that I didn't
say anything like that, because I don't remember being taught
about a definition of the term "whole numbers" at school at all.
(I /do/ remember learning it from other sources while I was at
school - I was the weird kid who read maths books in my spare time.)
Mine certainly didn't.
But you are significantly older than David. Not sure about James.
It would have been around 1984 when I first learned about terms
such as "the set of integers" in a rigorous manner.
On 26/03/2025 03:35, James Kuyper wrote:
On 3/25/25 21:04, Janis Papanagnou wrote:
On 22.03.2025 15:07, Waldek Hebisch wrote:I think he meant "one needs 2N-bit multiplication". "one" is a
Actually, to do fast division of N-bit number by fixed N-bit
number one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean
*one* multiplication of 2N bit numbers?
pronoun in this context, not a number.
While that is probably correct, coincidentally it is also just /one/ multiplication.
Roughly speaking, when you want division of "y" by a fixed - i.e.,
constant value known at compile time - number "x", you can do it by pre-calculating z = 2^n / x and then you implement "y / x" by "y * z
/ 2^n". (There's also some stuff to handle correct rounding,
especially with signed types.)
So that is one use of multiplications that need longer bit-lengths,
beyond the size of the numbers you actually want to count (pennies or whatever).
On 26/03/2025 10:59, Keith Thompson wrote:
David Brown <[email protected]> writes:
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much
you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
They do. But they understand it as "I owe the bank $100" - they don't
view it as "I have -$100 in my bank account". Even when looking at
On 22.03.2025 15:07, Waldek Hebisch wrote:
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one* >multiplication of 2N bit numbers? - Could you please explain that (by
an example, or could you provide a reference)?
(The reason for my question is that for integer divisions of length N
an old DSP I used required besides shifts effectively N subtractions
to create the result and modulus; it didn't use any multiplications.)
Janis
The debit credit system is confusing.
For mortgaging, I deal with a bank which gets something wrong on
statements: Would you believe it, they add together the value of the
checking account, and the mortgqge account, both being positive. Then
they call that the value of your account! E.g. if you have a $5,000
balance in the checquing account, and $50,000 in the mortgage account,
they call that a value of $55,000. I wrote them an e-mail and they acknowledged this, but nothing was done; typical bureaucracy.
They would not have made that mistake with -55,000 and 5,000.
Yes, but didn't your school education predate Georg Cantor and the development of set theory? :-)
On 26/03/2025 00:55, James Kuyper wrote:...
I was born just in time to be taught the New Math in school.
These days, of course, kids don't learn about any of this - they just
learn how to ask ChatGPT about it from their iPad.
On 22.03.2025 15:07, Waldek Hebisch wrote:
Actually, to do fast division of N-bit number by fixed N-bit number
one need 2N-bit multiplication.
I just stumbled across your post and above sentence. Do you mean *one* multiplication of 2N bit numbers? - Could you please explain that (by
an example, or could you provide a reference)?
On 26/03/2025 15:45, Richard Heathfield wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole numbers' as
James's school in US.
What makes you think so? Mine certainly didn't. This thread was the
first time in my life I've ever encountered the rather peculiar notion
that whole numbers exclude negatives. Now that I /have/ encountered that
notion, I see no compelling reason to endorse it.
Yes, but didn't your school education predate Georg Cantor and the development of set theory? :-)
On 3/26/25 05:00, David Brown wrote:
On 26/03/2025 00:55, James Kuyper wrote:...
I was born just in time to be taught the New Math in school.
These days, of course, kids don't learn about any of this - they just
learn how to ask ChatGPT about it from their iPad.
I'm currently raising two 9-year olds (yes, they were born when I was 56
- I've been late for almost everything in my life, including my marriage
- I hope that includes my funeral). They use ChromeBooks supplied by the school district, and as far as I know they've made no use of ChatGPT.
The biggest difference between the way they were taught math and the way
I was taught is something called a "number bond". The concept emphasizes
that 6 and 4+2 are the same quantity, so 5 is "bonded" to the
combination of 4 and 2. In other words, the concept is used to
encapsulate the distributive property. They attach as much or more
importance to that fact as I would attach to the fact that 6 and 2*3 are
the same quantity. I have no idea whether this is a good idea, just as
my parents had no idea whether the "New Math" was a good idea.
On 26/03/2025 16:40, David Brown wrote:
On 26/03/2025 15:45, Richard Heathfield wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole numbers' as >>>> James's school in US.
What makes you think so? Mine certainly didn't. This thread was the
first time in my life I've ever encountered the rather peculiar
notion that whole numbers exclude negatives. Now that I /have/
encountered that notion, I see no compelling reason to endorse it.
Yes, but didn't your school education predate Georg Cantor and the
development of set theory? :-)
Sedi ad pedes Euleri, ut numeros meos discerem, integros et aliter.
On 26/03/2025 18:25, Richard Heathfield wrote:
On 26/03/2025 16:40, David Brown wrote:
On 26/03/2025 15:45, Richard Heathfield wrote:
On 26/03/2025 14:01, Michael S wrote:
But your school in UK taught you the same meaning of 'whole
numbers' as
James's school in US.
What makes you think so? Mine certainly didn't. This thread
was the first time in my life I've ever encountered the
rather peculiar notion that whole numbers exclude negatives.
Now that I /have/ encountered that notion, I see no
compelling reason to endorse it.
Yes, but didn't your school education predate Georg Cantor and
the development of set theory? :-)
Sedi ad pedes Euleri, ut numeros meos discerem, integros et
aliter.
If you had used the original Greek, rather than Latin, I'd have
been /really/ impressed!
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
"Vix didici Lingua Anglica"?
Estne tempus hoc filo mori?
On 26/03/2025 21:12, Keith Thompson wrote:
"Vix didici Lingua Anglica"?
Close enough.
Estne tempus hoc filo mori?
morituri te salutant.
Janis Papanagnou <[email protected]> writes:
On 26.03.2025 12:33, David Brown wrote:[...]
Even in C (in a desperate attempt to bring us back on topic for the
group), there are no negative integer constants - merely positive
integer constants with a unary minus operator applied.
Is that so? (Harmlessly asking.) - I mean, if I write int x = -5;
does it matter (in "C") whether its parsed as <integer number> or
<negation> <positive number> ?
If -5 were a single token (an integer constant), then 6-5 would be an
integer constant 6 followed by an integer constant -5, a syntax error.
[...]
On 26/03/2025 15:01, Michael S wrote:
On Wed, 26 Mar 2025 10:00:40 +0100
David Brown <[email protected]> wrote:
On 26/03/2025 00:55, James Kuyper wrote:
On 3/25/25 19:38, Keith Thompson wrote:
Janis Papanagnou <[email protected]> writes:
[...]
For me there's an
additional practical fact to keep in mind; that what we call
"Ganzzahl" (whole numbers) isn't corresponding to what "whole
number" means in English,
What "whole numbers" means in English doesn't necessarily
correspond to what "whole numbers" means in English.
According to the Wikipedia article on integers, "The whole numbers
were synonymous with the integers up until the early 1950s In the
late 1950s, as part of the New Math movement, American elementary
school teachers began teaching that whole numbers referred to the
natural numbers, excluding negative numbers, while integer included
the negative numbers. The whole numbers remain ambiguous to the
present day."
That's an interesting historical point, thanks.
It's also important in such discussions to remember that the USA
doesn't have a monopoly on the English language, or maths - they
can't even spell "maths" correctly :-)
So "everyday English" usage will vary in time and space, as will the
definitions people were taught in school (which most "normal" folk
will have long forgotten anyway).
But your school in UK taught you the same meaning of 'whole numbers' as
James's school in US.
I haven't said any such thing - I cannot remember if my school taught
the term "whole number" at all, or whether or not we included 0 in
"natural numbers". (Usually I would not include 0 as a natural number without specifying it, but I can't tell you where that preference came
from.)
What I have said is that the term "whole number" in English usually
means non-negative integers. But I don't think it is entirely
consistent, and I don't know what is taught in schools in the UK or how
that might have changed or how consistent it is. (Note also that there
is no UK-wide education standard - education in Scotland, along with the legal system and religion, has always been completely separate in
Scotland despite the union of the crowns and the union of the parliaments.)
I am confident that the term "integer" is used consistently for the set
of positive, zero and negative integers throughout schools in the UK,
using the blackboard-Z symbol. But I have no idea when they
standardised on this, or whether there was a specific standardisation
effort or just a gradual change.
So, it seems, US and UK had common 'New Math'
movement that supposedly didn't affect majority of non-English-speaking
countries.
That also does not follow at all.
It is certainly /plausible/ that the countries cooperated on this. It
is far more likely that there was no connection at all.
On 26.03.2025 12:33, David Brown wrote:...
Even in C (in a desperate attempt to bring us back on topic for the
group), there are no negative integer constants - merely positive
integer constants with a unary minus operator applied.
Is that so? (Harmlessly asking.) - I mean, if I write int x = -5;
does it matter (in "C") whether its parsed as <integer number> or
<negation> <positive number> ?
Janis Papanagnou <[email protected]> writes:
On 26.03.2025 20:38, Keith Thompson wrote:[...]
If -5 were a single token (an integer constant), then 6-5 would be an
integer constant 6 followed by an integer constant -5, a syntax error.
This is generally not true; that depends on the syntax rules. It is
perfectly fine to have rules for 2-ary addition and subtraction and
have also negative (and positive) literals or expressions with unary
plus and minus operators.
Disclaimer: As usual I'm not speaking about any peculiarity that "C"
may (or may not) have defined in its standard, but generally.
I suppose it would be possible to define a language syntax that makes
-5 a single token and still parses 6-5 as (literal 6, binary-minus, literal-5).
I don't know of any language that uses "-" for both negation (prefix,
one operand) and subtraction (infix, two operands) and treats -5
as a single token rather than a unary minus operator applied to the constant/literal "5".
David Brown <[email protected]> writes:From my experience, most do not. In particular, if you gave them
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much
you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
On 3/26/25 05:59, Keith Thompson wrote:
David Brown <[email protected]> writes:From my experience, most do not. In particular, if you gave them
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much
you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
examples of a transaction and the relevant accounts, they would have no
idea which accounts should be debited, and which should be credited.
James Kuyper <[email protected]> writes:
On 3/26/25 05:59, Keith Thompson wrote:
David Brown <[email protected]> writes:From my experience, most do not. In particular, if you gave them
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much >>>> you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
examples of a transaction and the relevant accounts, they would have no
idea which accounts should be debited, and which should be credited.
Sure, most people don't understand double-entry bookkeepping. I was
thinking of simpler concepts. Depositing money increases your bank
account balance, withdrawing money decreases it, withdrawing too
much can result in a negative balance, and so on. A checking account
or credit card statement shows numbers with or without a "-" symbol.
Most of us here are probably in the top 10% of the general population
in terms of mathematical knowledge, and it can be difficult to know
how much knowledge most people have. But I think that most people
have a decent basic understanding of positive and negative numbers.
As I mentioned recently, temperatures might have been a better
example.
And this is *way* off-topic.
On 3/26/25 05:00, David Brown wrote:
On 26/03/2025 00:55, James Kuyper wrote:...
I was born just in time to be taught the New Math in school.
These days, of course, kids don't learn about any of this - they just
learn how to ask ChatGPT about it from their iPad.
I'm currently raising two 9-year olds (yes, they were born when I was 56
- I've been late for almost everything in my life, including my marriage
- I hope that includes my funeral). They use ChromeBooks supplied by the school district, and as far as I know they've made no use of ChatGPT.
The biggest difference between the way they were taught math and the way
I was taught is something called a "number bond". The concept emphasizes
that 6 and 4+2 are the same quantity, so 5 is "bonded" to the
combination of 4 and 2.
On 2025-03-27, James Kuyper <[email protected]> wrote:
On 3/26/25 05:59, Keith Thompson wrote:
David Brown <[email protected]> writes:From my experience, most do not. In particular, if you gave them
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much >>>> you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
examples of a transaction and the relevant accounts, they would have no
idea which accounts should be debited, and which should be credited.
Or, well, they would know because the transaction would say so.
It will always be a debit/credit pair identifying the accounts.
What they wouldn't necessarily know is whether they are supposed to add
the credit or subtract it from the given account, and likewise
for debit.
On 3/27/25 14:31, Kaz Kylheku wrote:
On 2025-03-27, James Kuyper <[email protected]> wrote:
On 3/26/25 05:59, Keith Thompson wrote:
David Brown <[email protected]> writes:From my experience, most do not. In particular, if you gave them
[...]
Sure. But most people have forgotten such details long ago - negative >>>>> numbers are not part of daily life (except as an indicator of how much >>>>> you owe the bank...). After all, negative numbers are not natural!
Most people understand credits and debits.
examples of a transaction and the relevant accounts, they would have no
idea which accounts should be debited, and which should be credited.
Or, well, they would know because the transaction would say so.
"Make a $1,000 payment from the checking account on the mortgage"
describes the transaction, but most people who aren't familiar with >accounting terms, would have trouble when reading that description
deciding whether the checking account should be credited with $1,000, or >debited, and similarly for the Mortgage.
[ dyadic and monadic minus operations, and minus sign at literals ]
I don't know of any language that uses "-" for both negation (prefix,
one operand) and subtraction (infix, two operands) and treats -5
as a single token rather than a unary minus operator applied to the constant/literal "5".
On 26.03.2025 23:15, Keith Thompson wrote:
[ dyadic and monadic minus operations, and minus sign at literals ]
I don't know of any language that uses "-" for both negation (prefix,
one operand) and subtraction (infix, two operands) and treats -5
as a single token rather than a unary minus operator applied to the
constant/literal "5".
I as well don't know. It may simplify things if the '-' is detached
from a numeric positive literal, especially for numeric expressions.
There's certainly cases where a signed numeric token is appropriate,
thinking (for example) about a CONST declaration in Pascal, like
CONST a = -5; here you don't have expressions, just the primitive
type literals.[*]
The point why I think that a signed literal as entity may be useful
is that it's a static (compile time) property; -5 is in that respect different from -x, the negation operation. A negative constant does
not "cost" a run-time operation.
Given what we recently discussed about a division by a constant,
where compilers (may) handle expressions by pre-calculating the
reciprocal for run-time efficiency, it's not that clear to me that
it matters either way.
I suppose it's a question of whether it complicates syntax definition
or parsing.
James Kuyper <[email protected]> writes:...
"Make a $1,000 payment from the checking account on the mortgage"
describes the transaction, but most people who aren't familiar with
accounting terms, would have trouble when reading that description
deciding whether the checking account should be credited with $1,000, or
debited, and similarly for the Mortgage.
I find that difficult to agree with. I have my grandfather's farm
records from the 40s and 50s. Born in 1903 on the same farm, eighth
grade education, yet his ledger sheets are double-entry "income"
and "expenses". Both recorded as positive
values (the difference beteween the sum of each column is the
profit or loss for the year).
On 29/03/2025 17:25, Janis Papanagnou wrote:
On 26.03.2025 23:15, Keith Thompson wrote:
[ dyadic and monadic minus operations, and minus sign at literals ]
I don't know of any language that uses "-" for both negation (prefix,
one operand) and subtraction (infix, two operands) and treats -5
as a single token rather than a unary minus operator applied to the
constant/literal "5".
I as well don't know. It may simplify things if the '-' is detached
from a numeric positive literal, especially for numeric expressions.
There's certainly cases where a signed numeric token is appropriate,
thinking (for example) about a CONST declaration in Pascal, like
CONST a = -5; here you don't have expressions, just the primitive
type literals.[*]
The point why I think that a signed literal as entity may be useful
is that it's a static (compile time) property; -5 is in that respect
different from -x, the negation operation. A negative constant does
not "cost" a run-time operation.
Given what we recently discussed about a division by a constant,
where compilers (may) handle expressions by pre-calculating the
reciprocal for run-time efficiency, it's not that clear to me that
it matters either way.
I suppose it's a question of whether it complicates syntax definition
or parsing.
Having a single token like '-1234' is pointless. Most languages allow
you to add parentheses like '-(1234)' which must give the exact same
result.
And many also reduce expressions like '1234+1' to '12345' at compile
time. In this case you'd want '-(1234+1)' to be equivalent to '-1235'.
Or there may be a named alias 'X' for 1234, and later write '-X'.
[...]
I don't know of any language that uses "-" for both negation (prefix,
one operand) and subtraction (infix, two operands) and treats -5
as a single token rather than a unary minus operator applied to the constant/literal "5".
--
Keith Thompson (The_Other_Keith) [email protected]
void Void(void) { Void(); } /* The recursive call of the void */
Keith Thompson <[email protected]> wrote:
[ .... ]
I don't know of any language that uses "-" for both negation (prefix,
one operand) and subtraction (infix, two operands) and treats -5
as a single token rather than a unary minus operator applied to the
constant/literal "5".
How about Lisp? The unary operator is (- 5), the binary (- 10 5).
It doesn't match your second parenthetical remark ("infix") but
otherwise it does.
On 2025-03-31, Alan Mackenzie <[email protected]> wrote:
Keith Thompson <[email protected]> wrote:
[ .... ]
I don't know of any language that uses "-" for both negation (prefix,
one operand) and subtraction (infix, two operands) and treats -5
as a single token rather than a unary minus operator applied to the
constant/literal "5".
How about Lisp? The unary operator is (- 5), the binary (- 10 5).
It doesn't match your second parenthetical remark ("infix") but
otherwise it does.
Lisp could be infix if we want with some macro:
(infix-environment
... (10 - (a * 3)) ...)
On 25/03/2025 11:55, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> writes:
On 25.03.2025 05:56, Tim Rentsch wrote:
Janis Papanagnou <[email protected]> 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'.
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'.
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.
Richard Heathfield <[email protected]> writes:
On 25/03/2025 11:55, Tim Rentsch wrote:
On 04/05/2025 05:03, Tim Rentsch wrote:
Richard Heathfield <[email protected]> writes:
On 25/03/2025 11:55, Tim Rentsch wrote:
<snip>
Tim, /please/ stop necroposting. When a long thread died out
over a month ago, it is usually because the participants lost
interest, or felt that anything worth saying on the topic had
been said,
or perhaps that the conversation had strayed too off
topic or become too heated.
Consider drawing the line at one week - I recommend you do not
reply to posts older than that unless you have something quite
exceptional to share.
On 04/05/2025 13:04, David Brown wrote:
On 04/05/2025 05:03, Tim Rentsch wrote:
Richard Heathfield <[email protected]> writes:
On 25/03/2025 11:55, Tim Rentsch wrote:
<snip>
Tim, /please/ stop necroposting. When a long thread died out over a
month ago, it is usually because the participants lost interest, or
felt that anything worth saying on the topic had been said,
...and all too often anything not worth saying.
or perhaps that the conversation had strayed too off topic or become
too heated.
If the resurrection is to make an interesting observation about C, I
think I could stand an exception, couldn't you?
Consider drawing the line at one week - I recommend you do not reply
to posts older than that unless you have something quite exceptional
to share.
Apparently you could. :-)
Perhaps /you/ thought his reply was worth bringing the thread
back to life
On 04/05/2025 17:39, David Brown wrote:
Perhaps /you/ thought his reply was worth bringing the thread back to
life
Not particularly; IIRC the woefully departed horse had already been thoroughly flogged, and - like you - I saw no reason to defibrillate it.
My reply was addressed more to the general (but more topical) case,
because I wouldn't want people to feel inhibited against making
genuinely interesting replies just because they'd been on holiday, say,
when the matter was discussed here.
On 04/05/2025 13:04, David Brown wrote:
On 04/05/2025 05:03, Tim Rentsch wrote:
Richard Heathfield <[email protected]> writes:
On 25/03/2025 11:55, Tim Rentsch wrote:
<snip>
Tim, /please/ stop necroposting. When a long thread died out over a
month ago, it is usually because the participants lost interest, or
felt that anything worth saying on the topic had been said,
...and all too often anything not worth saying.
or perhaps that the conversation had strayed too off topic or become
too heated.
If the resurrection is to make an interesting observation about C, I
think I could stand an exception, couldn't you?
Consider drawing the line at one week - I recommend you do not reply
to posts older than that unless you have something quite exceptional
to share.
Apparently you could. :-)
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (0 / 16) |
| Uptime: | 170:50:04 |
| Calls: | 12,097 |
| Calls today: | 5 |
| Files: | 15,003 |
| Messages: | 6,517,855 |