mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-29 07:04:09 +08:00
`x % c` for a constant c whose magnitude is a power of two of at least 1 now computes `x - trunc(x / c) * c`, which is exact for every double, and gives a zero result the dividend's sign. Divisors written as `2 ** k` count as constants. Other divisors keep frem, and a fractional constant divisor skips the integer check it can never pass. The inline integer path for unproven operands now accepts dividends up to 2^62 instead of 2^53. The remainder of two doubles is a double, so the conversion back is exact, and products such as `seed * 1103515245 + 12345` no longer call fmod.