Fix range floating point error.

I am not pretty sure if it applies for JS, but it supposed be a little bit faster, because we don't need `value` before increment.