Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Test-integerness/Elixir/test-integerness.elixir
Normal file
8
Task/Test-integerness/Elixir/test-integerness.elixir
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
defmodule Test do
|
||||
def integer?(n) when n == trunc(n), do: true
|
||||
def integer?(_), do: false
|
||||
end
|
||||
|
||||
Enum.each([2, 2.0, 2.5, 2.000000000000001, 1.23e300, 1.0e-300, "123", '123', :"123"], fn n ->
|
||||
IO.puts "#{inspect n} is integer?: #{Test.integer?(n)}"
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue