elixir-lang/elixir — pull request #2971 by jw2013 (2014-12-29 05:52:04+00:00)
Title: Integer.parse/2 shouldn't parse when base is not an integer

Right now spec of Integer.parse/2 correctly mentioned the base of Integer.parse/2 should be an integer, but the code does not currently comply with it. That is because of bug https://github.com/elixir-lang/elixir/issues/2912 causes numbers like 10.2 be considered in range 2..32.

```iex(1)> Integer.parse("34", 10.2)
{34.599999999999994, ""}
iex(2)> Integer.parse("34", 10.1231)
{34.3693, ""}
iex(3)> Integer.parse("34", 10.5)
{35.5, ""}
```

Before issue https://github.com/elixir-lang/elixir/issues/2912 is fixed we should check if the given base is an integer.