On 2020-01-12 11:32 p.m., ToddAndMargo via perl6-users wrote:
On 2020-01-12 20:03, Darren Duncan wrote:
A uint32 is NOT specifically a cardinal.
Since a uint32 ca not be negative or a fraction,
it is a cardinal. Other operating system do call
them cardinals, such as Modula2. Pascal, C++ (I
think C too), Java, and so on and so forth.
Yes, a uint32 CAN represent a cardinal, but it can ALSO represent an ordinal or
a nominal or various other things.
A uint32 is just as much an ordinal as a cardinal, so insisting on calling it
a cardinal means the type can't be used as an ordinal, or a variety of other
things.
https://www.dictionary.com/browse/ordinal-number
ordinal number
noun
Also called ordinal numeral. any of the numbers that
express degree, quality, or position in a series, as
first, second, and third *(distinguished from cardinal
number)*.
Mathematics. a symbol denoting both the cardinal number
and the ordering of a given set, being identical for
two ordered sets having elements that can be placed
into one-to-one correspondence, the correspondence
preserving the order of the elements.
https://www.dictionary.com/browse/cardinal-number
cardinal number
noun
Also called cardinal numeral. any of the numbers
that express amount, as one, two, three, etc.
*(distinguished from ordinal number)*.
No idea how you are mixing these two. I can see
how yo would use a cardinal in programming to
denote an ordinal, if that is what you are getting at.
These are different semantics applied to the same representations.
You tell me, take the following sequence:
0, 1, 2, 3, 4, ...
Does that sequence denote cardinals, or ordinals, or both, or something else?
I would say both. If you say it is only cardinals or only ordinals, then how do
you determine that it is just one and not the other.
Calling this an unsigned integer (u int) is much more accurate as it doesn't
presume a particular semantics such as that we are storing a count rather than
a position for example, it says what we actually know, and no more.
I am sorry, I have no idea what you are trying to say. I do not care if you
call a cardinal an unsigned integer. Just
don't call it an integer. The high bit in a cardinal is
part of the number and denotes a negative number in an integer.
What high bit? We're talking about mathematical definitions here, that's what
you're quoting from Wikipedia. Cardinals and ordinals and integers etc don't
have "bits" in mathematics, never mind a high bit.
The way I see it, you are making the mistake of confusing mathematical concepts
with possible representations for them in a computer. A cardinal or ordinal or
integer is a mathematical concept that is not defined in terms of bits. Each of
these has possible representations in a computer as a sequence of bits. The
same bit pattern that a uint32 holds can possibly represent either a cardinal or
an ordinal but is not a cardinal or an ordinal itself.
You are also wrong on saying that the values one can store in a uint32 are not
integers; they definitely ARE integers. Every cardinal is an integer.
Where do you get that. A cardinal can not be negative. An
Integer can. And the structure is even different: the high
bit in an integer denote the sign of the integer; the high bit
in a cardinal is just a higher positive number. So they
are not the same by any shake.
Again, take the following:
0, 1, 2, 3, 4, ...
I say that each of these is both a cardinal AND an integer. True that a
cardinal can not be negative, but both a cardinal and an integer CAN be
positive, so any positive whole number IS an integer just as it also IS a cardinal.
-- Darren Duncan