tech-userlevel archive

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

Re: silly behavior of factor(6)



On Thu, Apr 22, 2010 at 09:43:56PM +0300, markucz%gmail.com@localhost wrote:
> > 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:'.

0: 0 is *not* consistent. It is arguable the worst possible behavior.
Think about it: a factor divides the given number without a remainder.
You can't divide by 0. 1 as sole factor of 1 makes at least some sense
in the algebraic sense, as 1 is the unity in Z. Rejecting 0 makes a lot
of sense for the same reason -- as neutral element of the add operation,
it is already special for the multiplication and e.g. exempt from the
requirement of having a unique inverse in Z.

Joerg


Home | Main Index | Thread Index | Old Index