How to get longer int to not lose os.time() seconds?
Posted: 24 Jan 2010, 03:37
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.
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.