As a vaguely related observation, I recently found a bug in a JVM written in JavaScript which implemented the l2f (64-bit long to 32-bit float) instruction incorrectly as Math.fround(Number(x)), performing an intermediate conversion to double (because there's no way to directly round a JS bigint to float in one step). My workaround was to round the intermediate result to odd before calling Math.fround: <a href="https://gist.github.com/anematode/46bb73dbe6134cc861975c6443098af2" rel="nofollow">https://gist.github.com/anematode/46bb73dbe6134cc861975c6443...</a>