Gravity does not have infinite range. Simply put gravity happens when am the mass of a object is significant higher than an other object nearby. If you are hundreds of Km away from any significant mass on the universe, you will not be subject to gravity.
Latest Answers