This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc interprets -0 incorrectly
- From: Gaute B Strokkenes <gs234 at cam dot ac dot uk>
- To: Segher Boessenkool <segher at koffie dot nl>
- Cc: Justin Pryzby <justinpryzby at users dot sourceforge dot net>, gcc at gcc dot gnu dot org
- Date: Sun, 22 Dec 2002 15:02:28 +0100
- Subject: Re: gcc interprets -0 incorrectly
- Organization: The Church of Emacs
- References: <20021206224313.GA17796@perseus.homeunix.net><3E022433.25487788@koffie.nl>
On Thu, 19 Dec 2002, segher@koffie.nl wrote:
> Justin Pryzby wrote:
>>
>> * From algebra: it is clear that for all x=-x, 2x=0, x=0.
>
> x=0 is not implied by 2x=0 in this ring (the ring of integers
> modulo some power of two); this ring is not an integral domain,
> and 2 is a zero divisor.
>
> -MIN_INT == MIN_INT is perfectly fine, mathematically.
OTOH a lot of interesting theory only applies when 2 != 0;
specifically because the ability to divide by 2 turns out to be
particularly useful.
One of my lecturers when I was a maths undergraduate once said that
some people liked to do stuff in fields with characteristic 2 as a
kind of special spice; but that people who wish to remain sane should
stay away from them...
--
Gaute Strokkenes http://www.srcf.ucam.org/~gs234/
A KAISER ROLL?! What good is a Kaiser Roll without a little
COLE SLAW on the SIDE?