Print "inf" to output file if gap is infinity