julia
julia copied to clipboard
More information on the parse function.
Providing more information on how the parse function works with floating point literals would be great, as I've ran into situations where I thought it intuitive to work with the Float32
numeric literal, but it throws an error.
Providing a !!! note
up-front about this behaviour and how to go around it would be great to inform users to take notice of such occurrences.
I've had a rethink on this and it doesn't seems "elegant" to provide a !!! note
on a case where there's just one exception.
So its best to include the exception on # Example
and then show how to bypass it - in the example as well.
This seems concise and elegant and would even give users "an hint" to try out other numeric literals and see if they work as well - which they all do (to my best knowledge). And even if they don't, that can lead to a potential useful PR or even an ISSUE.
@KristofferC is still being looked into?
We could add more details of the type of formats we accept in parse
. For example:
julia> parse(Float64, "0x2.3ep5")
71.75
julia> parse(Int, "0o777")
511
but just adding a case of Julia syntax that doesn't parse doesn't seem worthwhile.