code: public double nextDouble(double lo, double hi) {
          if (lo < 0) {
              if (nextInt(2) == 0)
                  return -nextDouble(0, -lo);
              else
                  return nextDouble(0, hi);
          } else {
              return (lo + (hi - lo) * nextDouble());
          }
      }
docs: Generate a uniform random number in the range [lo, hi)
  
  @param lo lower limit of range
  @param hi upper limit of range
  @return a uniform random real in the range [lo, hi)