Comment
Comment by gurjeet
Use numeric data type instead of integer, and update the position to the midpoint of the other 2 you're trying to place the record between.
To get better performance you can choose to use the float data type, but then you'd be limited to a fixed precision; sufficient for most cases, though.