I'd like to convert a number to a string using only any Lua version, so that
there is no data loss (necessary!)
- the string representation is as small as possible (8 bytes would be fine) (optional, not necessary)
no external libs are used (necessary!)
- the conversion is as fast as possible (optional, not necessary)
I don't care about
- human readability
- avoiding special characters
I tried the built-in tonumber
function, but it does not always give correct results:
> print((2+256^6)==(1+256^6))
false
> print(tostring(2+256^6)==tostring(1+256^6))
true