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

**To**:**Martin Husemann <martin%duskware.de@localhost>****Subject**:**Re: CVS commit: src/games/factor****From**:**David Holland <dholland-sourcechanges%netbsd.org@localhost>**- Date: Mon, 17 May 2010 02:08:16 +0000

On Sun, May 16, 2010 at 10:49:22PM +0200, Martin Husemann wrote: > On Sun, May 16, 2010 at 07:30:54PM +0000, David Holland wrote: > > of which at least the 0 case is clearly incorrect... > > That obviously depends on the meaning you give the output, which is > not well defined in the man page and obviously a lot people around > here disagree about. > > I would say the list of prime factors of 0 is empty, so "0:\n" makes > perfect sense to me. Right, but on the other hand (as I mentioned elsewhere) we'd like for the product of the numbers output to be equal to the number input, because if that's not true then it cannot be a factorization. Since there's no set of prime factors whose product is zero, erroring on zero is a reasonable approach. Printing "0: 0\n", so the product of the RHS is zero even though it's not a prime factorization, is not strictly valid but not entirely unreasonable. However, in "0:\n" the product of the RHS is 1, and that seems undesirable. -- David A. Holland dholland%netbsd.org@localhost

**References**:**Re: CVS commit: src/games/factor***From:*David Laight

**Re: CVS commit: src/games/factor***From:*Aleksej Saushev

**Re: CVS commit: src/games/factor***From:*Quentin Garnier

**Re: CVS commit: src/games/factor***From:*Martin Husemann

**Re: CVS commit: src/games/factor***From:*Martin Husemann

**Re: CVS commit: src/games/factor***From:*David Holland

**Re: CVS commit: src/games/factor***From:*Martin Husemann

- Prev by Date:
**Re: CVS commit: src/games/factor** - Next by Date:
**Re: CVS commit: src/games/factor** - Previous by Thread:
**Re: CVS commit: src/games/factor** - Next by Thread:
**re: CVS commit: src/games/factor** - Indexes: