docs: public static String asString(double d) {
          long l = (long) d;
          if (d > ((10 << 9) - 1) || (1 / d) > (10 << 6)) {
              // Scientific notation should be used.
              return SCIENTIFIC_FORMATTER.format(d);
          } else if (d == (double) l) {
              // actually an integer or long value.
              return Long.toString(l);
          } else {
              return DOUBLE_FORMATTER.format(d);
          }
      }