Re: Dawn doesn't like 1NF

From: Marshall Spight <mspight_at_dnai.com>
Date: Sat, 16 Oct 2004 03:13:17 GMT
Message-ID: <hl0cd.188364$wV.92433_at_attbi_s54>


"Laconic2" <laconic2_at_comcast.net> wrote in message news:ye2dnRyBk-N2rO3cRVn-qQ_at_comcast.com...

>

> There's more here than meets the eye. Testing two of a UDT for equality is
> a whole lot more subtle than comparing the bits, bit by bit. I'm not
> convinced that two values drawn from the same complex domain can be easily
> tested for equality.

Any feelings people have that this problem is complicated is an artifact of the fact that all the systems we have *make* this problem complicated. But the problem itself is simple: you compare all the logical subelements, part by part, recursively, until you get to the primitives, which you can compare directly.

> Is {1, 2, 3} equal to {2, 3, 1} ?

Yes.

> Is 3.21E3 equal to 32.1E2 ?

Is three thousand two hundred and ten equal to three thousand two hundred and ten? Certainly.

There are only two areas of complexity in equality: identity and precision. Identity disappears completely if you don't allow pointers in the language. Precision is harder: is the rational number 1/3 equal to the IEEE-754 double precision floating point value 1.0d/3.0d? Sadly no, but this is a simple consequence of having finite precision floating point numbers. Rationals have no such trouble, but floats are implemented in hardware, so we typically must bow down before their awesome performance.

Marshall Received on Sat Oct 16 2004 - 05:13:17 CEST

Original text of this message