Thread: 0 and 00
View Single Post
  #25 (permalink)  
Old Mon Nov 21, 2016, 12:18pm
jTheUmp jTheUmp is offline
TODO: creative title here
 
Join Date: Sep 2009
Location: Minneapolis, MN
Posts: 1,250
Quote:
Originally Posted by bwburke94 View Post
The difference here is that 0 (or 5) has the same value as 00 (or 05), just with a meaningless zero added at the start. 3 does not have the same value as 33.

Because of the way computers work, there is no way for them to distinguish between 0 and 00, or 5 and 05, in some cases.
Computer programmer checking in:

05 and 5 (or 0 and 00) are equivalent only if the uniform number is stored as an Integer. If they're stored as a String, 05 and 5 are not identical.

About the only real reason you'd store uniform number as an Integer is to make sorting easier... sorting Integers in numerical order (as you would expect in a box score) is easier than sorting Strings in numerical order... with Strings, the default order will be something like this:
0
00
02
03
1
01
12
14
2
22
25
3
31
32
34
etc.
Reply With Quote