public static double parseDouble(String s){
  s=s.trim();
  int length=s.length();
  if (length == 0) {
    throw invalidReal(s,true);
  }
  char last=s.charAt(length - 1);
  if (last == 'y' || last == 'N') {
    return parseName(s,true);
  }
  StringExponentPair info=initialParse(s,length,true);
  if (info.infinity || info.zero) {
    return info.specialValue();
  }
  double result=parseDblImpl(info.s,(int)info.e);
  if (Double.doubleToLongBits(result) == 0xffffffffffffffffL) {
    throw invalidReal(s,true);
  }
  return info.negative ? -result : result;
}

public static double parseDouble ( String s ) { s = s . trim ( ) ; int length = s . length ( ) ; if ( length == 0 ) { throw invalidReal ( s , true ) ; } char last = s . charAt ( length - 1 ) ; if ( last == 'y' || last == 'N' ) { return parseName ( s , true ) ; } StringExponentPair info = initialParse ( s , length , true ) ; if ( info . infinity || info . zero ) { return info . specialValue ( ) ; } double result = parseDblImpl ( info . s , ( int ) info . e ) ; if ( Double . doubleToLongBits ( result ) == 0xffffffffffffffffL ) { throw invalidReal ( s , true ) ; } return info . negative ? - result : result ; }
returns the closest double value to the real number in the string .
