Integers with leading zeroes

Rustom Mody rustompmody at gmail.com
Wed Jul 22 10:03:38 EDT 2015


On Wednesday, July 22, 2015 at 7:21:29 PM UTC+5:30, Grant Edwards wrote:
> On 2015-07-22, Ben Finney wrote:
> > Laura Creighton writes:
> >
> >> The biggest use I have for decimal numbers that begin with 0 is in
> >> credit card numbers, account numbers and the like where the first
> >> check you do is 'does this thing have the correct number of digits'.
> >
> > The following are examples of types from the real world that people
> > think of, and casually discuss, as "numbers".
> >
> > * Postal code
> > * Credit card number
> > * Telephone number
> > * Car registration plate number
> > * Personal Identification Number (PIN)
> 
> Those are all strings.  Not numbers.

Cobol would represent these well (if I remember rightly) as
PIC 9(n) USAGE DISPLAY
The USAGE DISPLAY was the default and unnecessary to state explicitly whereas
the alternative USAGE COMP(UTATIONAL) corresponds to what most post-COBOL 
programmers think of as (binary) numbers.

[Just sayin'... NOT asking for python to have 'usage display' ints]



More information about the Python-list mailing list