Ensure no overflow when calculating fpos