4 ms·
The first line is revealing; "contains" is not an operation usually performed on numbers. Does the number 21 "contain" the number 2? Not in a meaningful sense.
by pphysch 4y ago
The first line is revealing; "contains" is not an operation usually performed on numbers.
Does the number 21 "contain" the number 2? Not in a meaningful sense.
However, the string "21" definitely contains the substring "2".
- eyelidlessness 4y agoI’m not sure how it’s taught now, or how it might vary by teaching method, but the way I learned multiplication and division definitely treated the number 21 as “containing” the digit 2. I agree with the conclusion that a CC identifier should be treated as a string, but I don’t find this reasoning to be a compelling argument for that conclusion.
- kalleboo 4y agoIt contains the digit 2, but not the number 2. It's a string of digits, not a singular number.
- MBCook 4y agoBut that’s the difference isn’t it? In a number each digit represents groups of powers of ten. The number of hundreds, thousands, etc in the number. The digits in a credit card number are meaningless. They have no relation to each other. If you choose two digits next to each other one doesn’t represent groups of 10x as much as the other digit. Or any other quantity. The digits are effectively just symbols, not quantities like in a mathematical representation.