lua-users home
lua-l archive

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


> * "partial order": 5.0w0 already solved the "bug" about comparisons with
> NaN (Not a Number):
>
>   nan = 10e500/10e500
>   print(nan < 3)      --> false
>   print(nan <= 3)     --> false
>   print(nan > 3)      --> false
>   print(nan >= 3)     --> false
>   print(nan < nan)    --> false
>
> However, it is not possible to do a similar thing through the "lt"
> fallback.

What about my suggestion of an le fallback? (In brief: an le fallback is
sufficient for partial ordering; for greater efficiency and backwards
compatibility, you can have an lt fallback as well, and use the following
rules:

< uses lt if available, otherwise a < b => a <= b and not b <= a
<= uses le if available, otherwise lt as at present (but won't work for
partial orders)

)