Float.parse
You're seeing just the function
parse
, go back to Float module for more information.
Specs
Parses a binary into a float.
If successful, returns a tuple in the form of {float, remainder_of_binary}
;
when the binary cannot be coerced into a valid float, the atom :error
is
returned.
If the size of float exceeds the maximum size of 1.7976931348623157e+308
,
the ArgumentError
exception is raised.
If you want to convert a string-formatted float directly to a float,
String.to_float/1
can be used instead.
Examples
iex> Float.parse("34")
{34.0, ""}
iex> Float.parse("34.25")
{34.25, ""}
iex> Float.parse("56.5xyz")
{56.5, "xyz"}
iex> Float.parse("pi")
:error