Skip to content

Instantly share code, notes, and snippets.

@mrtzh
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrtzh/2885470fed1c2110c974 to your computer and use it in GitHub Desktop.
Save mrtzh/2885470fed1c2110c974 to your computer and use it in GitHub Desktop.
Julia bug in string to float conversion
float("1\n")
# converts to 1.0 of type Float64
float(split("1\n")[1])
# still converts to 1.0 of type Float64
float(split("0,1\n",",")[2])
#ERROR: ArgumentError("float64(String): invalid number format")
# in float64 at string.jl:1594
# in float at string.jl:1607
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment