6 ms·
this is the thing with JS and TS - the types and stuff, it's all good until you realise that all integers are basically int 52 (represented as float 64, with 52
by BillyTheKing 2y ago
this is the thing with JS and TS - the types and stuff, it's all good until you realise that all integers are basically int 52 (represented as float 64, with 52 bits for the fraction).
Yes, it's nice and flexible - but also introduces some dangerous subtle bugs.
- 8n4vidtmkvmk 2y ago2^53-1 I thought. And no, they're not all that. There's a bunch that are 2^32 such as this timeout, apparently, plus all the bit shift operations.
- vhcr 2y agoNot ALL integers are 52 bit, BigInts were added on ECMAScript 2020.