tech-userlevel archive

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

Re: silly behavior of factor(6)



Joerg Sonnenberger <joerg%britannica.bec.de@localhost> writes:

> 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.

n = d*q + r
0 = 0*q + 0

I don't see why you can't.


-- 
HE CE3OH...



Home | Main Index | Thread Index | Old Index