toString method

String toString()
override

Returns a string representation of this number, in either standard or scientific notation. If the magnitude of the number is in the range 10<sup>-3</sup>, 10<sup>8</sup> standard notation will be used. Otherwise, scientific notation will be used.

@return a string representation of this number

Implementation

String toString() {
  int mag = magnitude(hi);
  if (mag >= -3 && mag <= 20) return toStandardNotation();
  return toSciNotation();
}