Fix range floating point error.

why switch from i++ to ++i?