Page 1 of 1

How to get longer int to not lose os.time() seconds?

Posted: 24 Jan 2010, 03:37
by zwzsg
So, I noticed os.time() doesnt get incremented every second.

Then I realised that's because it's such a big number its floating point representation make it drop the second.

<zwzsg> How big can Lua integers be before they start to lose some digits?
<[LCC]jK> 2^24

For exemple, now os.time() is 1264300032, why is about a hundred time bigger than 16777216.

Thanksfully, using os.date() can return a formatted string with the exact second count.