lua-users home
lua-l archive

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


On 16-09-26 09:41 AM, Ką Mykolas wrote:
> I wonder if there is an easy way of checking if the number does not
> exceed the precision cap BEFORE converting to some base...
math.frexp. Second result is bits needed.

> math.frexp(tonumber("5c7d528b825b090", 16))
0.7225745373914	59

> math.frexp(tonumber("FFFF", 16))
0.99998474121094	16

In lua5.3 this function is somewhy deprecated (but still available).

Sorry for late reply.