Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
Double f = Double.valueOf(s);
double f = Double.parseDouble(s);

Will throw NullPointerException if s is null or NumberFormatException if s does not actually represent a float.
Float f = Float.valueOf(s);
(Float/parseFloat s)

This calls down to Java, and thus only when running Clojure on that platform.

New implementation...