public static double toDouble ( String x ) throws NumberFormatException { if ( "nan" . equals ( x ) ) { return Double . NaN ; } if ( "inf" . equals ( x ) ) { return Double . POSITIVE_INFINITY ; } if ( "-inf" . equals ( x ) ) { return Double . NEGATIVE_INFINITY ; } return Double . parseDouble ( x ) ; }
Parses the given string into a scalar value