tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: silly behavior of factor(6)

Does anyone know of any reason to maintain this silly behavior?

(And does anyone want to bikeshed about whether 0 should generate
   0: 0
or nothing at all but continue to the next number?)
Well, if you can factor 1, why not 0 too? If 'factor 1' gives '1: 1', I guess
'factor 0' should be '0: 0'. At least it won't break piping to e.g. awk and
will keep factor's behaviour consistent. If it continues to the next number
you'll get one line less of output which might be confusing. It doesn't
really matter, just flip a coin :)

Since the manual specifies "positive integer", 0 is invalid input (it's not in Z+). If one instead means "non-negative" (x>=0), 0 has infinite factors. The manual might want to specify (x>0) to note that positive does not mean non-negative.

Home | Main Index | Thread Index | Old Index