list_to_float

James Hague jamesh@REDACTED
Wed Aug 9 20:28:14 CEST 2006


>The current implementation is limited to string only argument - this is 
>reasonable, but it's not clear why implementation is limited to narrow 
>X.X representation? Couldn't float be expressed as "0"?

"0" in Erlang means "integer zero."  You need to specify "0.0" for a float.
Try these in the shell:

is_integer(0 + 1).    % gives true
is_integer(0.0 + 1).  % gives false

>As to list_to_number idea, what type of result is expected? Depending on 
>argument text representation?
 
Correct.  It's analogous to the is_number function, which checks if a value
is either an integer or float.



More information about the erlang-bugs mailing list