code: public static float pointRectDistance (IRectangle r, IPoint p) {
          return FloatMath.sqrt(pointRectDistanceSq(r, p));
      }
docs: Returns the Euclidean distance between the given point and the nearest point inside the
  bounds of the given rectangle. If the supplied point is inside the rectangle, the distance
  will be zero.