Ok, it appears there are several problems here:
- RANDOM returns an inexact Scheme number, which makes all the following calculations happen with floating point numbers. Floor and ceiling also report inexact numbers when the input is an inexact number, so those also produce weird outputs. But if you replace ROUND with SCHEME NUMBER [exact] OF, you'll see the calculations work as expected.
- For some reason, when the inexact Scheme numbers get too big, calculations are returning 0 instead of Infinity.
- Since there's no bignum version of the ROUND block, it's returning a regular JS floating point number. When one of these is encountered, the number is automatically coerced to an exact Scheme number, making the calculations work as expected.