Ask HN: How is 100 % 13 and Number.MAX_SAFE_INTEGER % 13 just as expensive?
It takes about 10 milliseconds to execute 1m modulus operations on Number.MAX_SAFE_INTEGER and about 5 milliseconds to execute 1m modulus operations on 100.
But I can't wrap my head around how.
How is it virtually just as fast to find the remainder of such a large and small number in Javascript?
Number.MAX_SAFE_INTEGER is 2^53 - 1 (9,007,199,254,740,991 or ~9 quadrillion).