# Assignment V equality (was: Bliss was Re: DEC program listing

Tom Jennings tomj at wps.com
Wed Aug 17 16:34:20 CDT 2005

On Wed, 17 Aug 2005, Fred Cisin wrote:

> On Wed, 17 Aug 2005, Tom Jennings wrote:
>> On Mon, 15 Aug 2005, Fred Cisin wrote:
>>>>> I fail to see how i = i + 1 is not obvious to only but the most
>>>>> simple-minded of people :)
>
>
> Sorry, but I was NOT the one who said that.  Probably Sellam.

Oh sorry, yes, I realized you had elaborated on this when I
replied, however, my mail composer did not and I didn't notice it
did it's simplistic fiddling. My bad! Probably a programming error
caused by a compiler parsing error :-)

> Many of them are actually otherwise intelligent, but they have not learned
> how to think procedurally, and have been trained to think that '=' means
> that two expressions are interchangable with each other.

It's just these sorts of circumstances that justify physical
violence.

> thereby wasting the most important capability of a variable!

For computing, yes. For humans, it's confusion! Imagine if
astronomers got to change h! Bastards.

> float X;     /* as IEEE 32 bit single precision */
> X = 2147483648.0;
> if (X == (X + 1)) . . .       can come out as TRUE!!
> (again: do NOT show that to a mathematician!)

But as Alan Turing pointed out, floating point arithmetic is NOT
arithmetic. It's a valuable simulation (approximation) of
arithmetic. Your example illustrates that perfectly. The need to
normalize is the 2x4-upside-the-head hint that all is not well.
The horrors involved are worse than Perl and BASIC combined.

float X;	     /* as IEEE 32 bit single precision */
int n;

X = 2147483648.0;
n= 0;
while (X == (X+1)) {
printf "fa la la...\n";
++n;
}
print ("%f combobulates %d fa la la's.\n", X, n);

Great! We love it!

>> PS: I'm no purist, I prefer perl; I simply acknowledge I'm
>> swimming in shit.
>
> ... the only thing as common as Hydrogen and stupidity!

Eh, I just take a shower and bury the bodies well.