Todd, nothing you said disagrees with what I said, and I referenced that same
Wikipedia article. (Though perhaps I could have been more accurate in saying a
cardinal is characterized by an integer rather than saying it is an integer with
a particular interpretation.) In particular, the article is explicit that there
is no limit to how many cardinal numbers there are. So saying cardinal number
is equivalent to a fixed size 32-bit integer is wrong, which is my point.
(Also, negative quantities/counts are a common concept, but I can accept that
the formal definition of cardinal excludes them.) -- Darren Duncan
On 2020-01-03 12:03 a.m., Todd Chester via perl6-users wrote:
On 2020-01-02 22:19, Darren Duncan wrote:
On 2020-01-02 10:01 a.m., ToddAndMargo via perl6-users wrote:
How do I do a 32 bit unsigned integer (cardinal)? I
have a situation where I need to be able to have the
first bit be a one and not have Raku think it is
a negative number.
Why do you use the term "cardinal" to refer to a 32 bit unsigned integer?
The term "cardinal" in practice is just an integer/number of any magnitude
with the added semantics of representing a quantity/count of something in
contrast to say an ordinal position or name of something.
Cardinals can't be negative. Think of them as counting numbers
The term definitely does not represent a fixed-size number and it can also be
negative.
You are confusing a cardinal with an integer. An easy mistake
to make
-- Darren Duncan
Hi Darren,
Cardinal number
https://simple.wikipedia.org/wiki/Cardinal_number
"Cardinal numbers (or cardinals) are numbers that say how
many of something there are, for example: one, two,
three, four, five, six. They are sometimes called
counting numbers. "
Cardinal Numbers
https://www.mathsisfun.com/numbers/cardinal-ordinal-nominal.html
"A Cardinal Number says how many of something there are,
such as one, two, three, four, five.
A Cardinal Number answers the question 'How Many?'"
Modula-2 Basic Data Types
https://www.modula2.org/sb/env/index75.htm
CARDINAL 16-bit compiler: 2 bytes 0 to 65535
32-bit compiler: 4 bytes 0 to 4,294,967,295
I was pretty good at Modula2 back in the day,
:-)
-T