Source-Changes-D archive

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

Re: CVS commit: src/games/factor

Martin Husemann <> writes:

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

Which is wrong because product over empty set, tuple, or list, depending
on how you define it, is multiplicative unit. And zero isn't multiplicative 
This isn't arbitrary, it makes less special cases such as in

forall x, y  (product over x)*(product over y) = (product over union(x, y))

If any of x and y is empty, you should either have unit product or special-case.

If you studied computer science, you know that

[1]> (and)
[2]> (*)
[3]> (or)
[4]> (+)

and corresponding in Scheme

guile> (and)
guile> (*)
guile> (or)
guile> (+)

And this again isn't neither accidential nor arbitrary.


Attachment: pgpryOMHbBxm3.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index