lua-users home
lua-l archive

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

> The other alternative is not to derive one ordering from relation
> from the other.

No, there's no problem with doing this. I brought this subject up quite

> is being ignored and standards broken? The problem is not in strtod,
> not in ANSI C, or POSIX, not in IEEE, but simply in how LUA
> determines ordering from 'lt' and how it handles boolean conditions
> in general.

As I said before, the current ordering relation only works for total
orders. For partial orders, it's sufficient to use a single tag method,
le, and deduce operators as follows:

a < b <=> a <= b and not (b <= a)
a >= b <=> b <= a
a > b <=> b <= a and not (a <= b)

> I would like to use LUA as the embedded scripting language in a
> relational database engine, but I need nil and nan ordering to work
> in the correct manner (ie IEEE for NaN). And quite simply it is
> currently impossible to convince LUA to work in the correct manner,
> because there is only one tag 'lt'.

So for those who didn't believe me before (when I merely wanted to
compare sets), here's a solid real world reason for fixing ordering!

-- | perfect, a.  unsatirizable