public String toString(){
  if (val == null)   return "null";
  if (val instanceof Long || val instanceof Integer) {
    return Long.toString(val.longValue());
  }
  double d=val.doubleValue();
  if (Double.isInfinite(d))   return (d > 0) ? "(1.0 / 0.0)" : "(-1.0 / 0.0)";
  if (Double.isNaN(d))   return "(0.0 / 0.0)";
  return Double.toString(d);
}

public String toString ( ) { if ( val == null ) return "null" ; if ( val instanceof Long || val instanceof Integer ) { return Long . toString ( val . longValue ( ) ) ; } double d = val . doubleValue ( ) ; if ( Double . isInfinite ( d ) ) return ( d > 0 ) ? "(1.0 / 0.0)" : "(-1.0 / 0.0)" ; if ( Double . isNaN ( d ) ) return "(0.0 / 0.0)" ; return Double . toString ( d ) ; }
returns the string representing the object
