math.random fails for very high numbers - different for each device

print(math.random(1, 1e10))

Works fine on MacOS 26.1.
On Windows 11 Pro 64-bit, it errors with this:

invalid argument #2 to 'random' (interval is empty)

If math.random is meant to fail with very high numbers then that’s fine I suppose. But it should definitely not have different cutoffs depending on which device it’s running on.

Thank you for the report.

Like you correctly mentioned, this behavior is platform-dependant.
We do not plan to make any changes in this area.

Note that the correct arguments for math.random are ‘integers’:
https://create.roblox.com/docs/reference/engine/libraries/math#random

1e10 is not a 32 bit integer.

Shouldn’t you just raise an error when a higher integer is provided? Instead of making it spontaneously error on hardware that the developer might not even own?

This would be good as a typecheck warning, right?

That would not be backwards-compatible for existing experiences that misuse the allowed range, but not catastrophically.