erlang:binary_to_integer(<<"+">>) returns 0

"-E:), niku" <[email protected]> Fri, 31 Jul 2015 02:40:42 +0900
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <CAFrD6ZtqgGqbHmo087NhQMXGxTingTasS7aKcghzJpir1ga19g@mail.gmail.com>
Hi folks.

erlang:binary_to_integer(<<"+">>) and
erlang:binary_to_integer(<<"-">>) return 0

I think it should cause exception same as erlang:list_to_integer("+").

Here is an example

$ erl
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4]
[async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Eshell V6.4  (abort with ^G)
1> binary_to_integer(<<"+">>).
0
2> binary_to_integer(<<"-">>).
0

regards.
_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs