lua-users home
lua-l archive

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


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
math-lib.

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...

Ciao, ET.