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 11:29:26AM +0200, Kristaps Dzonsons 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 wrote that last night and I specifically wrote "positive" because
the code does not currently do anything useful for zero. I don't think
there's any need to clarify that - anyone who cares will know what it
means and anyone who suspects we don't know what it means can easily
check that we do.

It can easily reject zero like it rejects negative numbers. Or it
could stop rejecting negative numbers and output a -1 factor for them,
which it apparently used to do at some point in the past. This is all
trivial; the question is whether anyone knows of any reason to care
much which of these alternatives is chosen.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index