Source-Changes-D archive

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

Re: CVS commit: src/games/factor

On Sat, May 15, 2010 at 09:22:39PM +0000, Joerg Sonnenberger wrote:
> Log Message:
> Follow the Fundamental Theory of Algebra. Disallow factorising of
> numbers less than 2 as it is not
> - naturally unique (negative numbers)
> - finite (0)
> - non-empty (1)

The 'Natural numbers (N)' are the positive integers, for which both addition
and multiplication are defined.
To make an additive group you need to include zero, zero is also needed to
make a number field.
If you include the subtraction operator then you need to include the
negative numbers - this gives the 'Integers (Z)'.
The notion of 'primes' is valid in Z - the definition of a prime is a
number that has no non-unit factors.
The units of Z are +1 and -1, so both +2 and -2 are primes (etc).

So nothing about algebra stops you factoring negative numbers.
However, since the 'prime factors' should be prime numbers, they
shouldn't include -1, but maybe the smallest factor should be negative.


David Laight:

Home | Main Index | Thread Index | Old Index