posted 21 years ago
from SDK documentation:
public static float parseFloat(String s)
throws NumberFormatException
Returns a new float initialized to the value represented by the specified String, as performed by the valueOf method of class Float.
public static Float valueOf(String s)throws NumberFormatException
Returns a Float object holding the float value represented by the argument string s.
Otherwise, s is regarded as representing an exact decimal value in the usual "computerized scientific notation";
THIS PART IS IMPORTANT:
this exact decimal value is then conceptually converted to an "infinitely precise" binary value that is then rounded to type float by the usual round-to-nearest rule of IEEE 754 floating-point arithmetic, which includes preserving the sign of a zero value. Finally, a Float object representing this float value is returned.
"Did anyone understand what I have just explained? ... because I did not!"