Fixed floating point precision issue in caculating number of range gates