logoalt Hacker News

themafiatoday at 5:50 AM2 repliesview on HN

66 days + 12 hours are 5,745,600,000,000,000 ns. The log2 of this is 52.351...

Javascript and some other languages only have integer precision up to 52 bits then they switch to floating point.

Curious.


Replies

loegtoday at 6:06 AM

It's 32 bits of milliseconds, right? Hm, no, that would overflow much sooner (49.7 days).

show 1 reply
loegta3today at 11:26 AM

Bingo! Someone decided to store timestamps in float64 which has 52 bit mantissa, and the time functions break when losing precision.