[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: equal tag method [was Re: unicode and locale again]
- From: Edgar Toernig <froese@...>
- Date: Wed, 26 Jun 2002 20:23:55 +0200
Roberto Ierusalimschy wrote:
> > Uhh... sure you want that?
> No ;-) On the other hand, order tag methods are much less useful without
> a corresponding equality operator.
I was satisfied with the simpe "less-than" and the identity '==' ;-)
> > I_M_HO even the partial ordering stuff is overkill for Lua
> At one hand we agree. On the other hand, we felt "forced" towards
> partial ordering by the NaN issue. Lua must give "correct" results
> (whatever the machine considers correct) for NaN comparisons.
Why do you want to mimic the behavior of the used C compiler? Just
define your own rules that are valid on every system; i.e. raise an
error on an unordered comparison (that's even a requirement in IEC
60559). To help math-geeks you could provide C-like "non-signaling"
methods like isgreater, isgreaterequal, isnan, isnormal, ... in the
And for things that are too hard just go the ANSI-C way: The behavior
is implementation defined ;-)
Most people don't care about NaNs - for them a NaN is an error condition...