lua-users home
lua-l archive

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


On 26.08.2012 8:09, Paul K wrote:
Agree; I just sent an improved version that shouldn't suffer from this problem.

I see we used the same idea of first comparing the length of numbers and then using lexicographical comparison of numbers. The improved version does still suffer from the bug caused by appending (99-#z): "012b" > "12a", whereas it should be "012b" > "12a".
In case "#t == 1" you shouldn't append #r, because "0.11" < "0.2".
You made me also think about the real numbers case. My attempt at implementing it has these bugs so far:
"." < " "   -- you'll face the ("." > "/") bug instead
"0.100a" > "0.1b"
I doubt the real numbers case has a use though :)

--
Best regards,
Sergey Rozhenko                 mailto:sergroj@mail.ru