fixed possible float64 to int64 conversion overflow