tech-userlevel archive

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

Re: silly behavior of factor(6)



>> 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.
> I still remember my math, thank you very much. Strictly speaking, a '1' isn't
> valid argument either, since it has no prime factors. So if you break the
> rules once, why not twice? factor should either stay as it is, or display
> '0: 0' for the sake of consistency. FYI, GNU factor accepts both 0 and 1 but
> outputs '0:' and '1:'.

According to the manual, 0 is invalid input (not posint), while 1 is
valid input (posint) that happens to have no prime factors.  Producing
"0:" is ignoring what the manual stipulates.  "1:" is correct behaviour.


Home | Main Index | Thread Index | Old Index