I would generally expect the string "5" to be parses into the double
5.0, and the string "5f" not to be parsed. However I noticed, with big
surprise, that the string "5f" is also parsed into the double 5.0. So is
the string "5d".
I assume that the method parseDouble sees d and f as suffixes for the
type float and double. In fact, all the other letters after the number
5, including l, seem to fail.
This looks pretty strange to me, and I would like to find a way get an
error when parsing "5f" or "5d". Any help appreciated.
Thanks
Juergen Nickelsen - 07 Jul 2005 10:38 GMT
> I assume that the method parseDouble sees d and f as suffixes for
> the type float and double. In fact, all the other letters after the
> number 5, including l, seem to fail.
This is as documented in Double.parseDouble()/valueOf() and section
3.10.2 of the language specification.

Signature
For all resources, whatever it is, you need more. -- RFC 1925
Andrea Desole - 07 Jul 2005 10:44 GMT
> This is as documented in Double.parseDouble()/valueOf() and section
> 3.10.2 of the language specification.
Damn, why don't I read the documentation of methods referred to by other
methods' documentation.
Thanks