Code.load_file("grains.exs")
ExUnit.start

defmodule GrainsTest do
  use ExUnit.Case

  test "square 1" do
    assert 1 == Grains.square(1)
  end

  test "square 2" do
    assert 2 == Grains.square(2)
  end

  test "square 3" do
    assert 4 == Grains.square(3)
  end

  test "square 4" do
    assert 8 == Grains.square(4)
  end

  test "square 16" do
    assert 32768 == Grains.square(16)
  end

  test "square 32" do
    assert 2147483648 == Grains.square(32)
  end

  test "square 64" do
    assert 9223372036854775808 == Grains.square(64)
  end

  test "total grains" do
    assert 18446744073709551615 == Grains.total
  end
end

Code.load_file("grains.exs")
ExUnit.start

# NOTE: :math.pow/2 doesn't do what you'd expect:
# `:math.pow(2, 64) == :math.pow(2, 64) - 1` is true.
#
# It's best to avoid functions operating on floating point numbers for very
# large numbers.

defmodule GrainsTest do
  use ExUnit.Case

  test "square 1" do
    assert 1 == Grains.square(1)
  end

  test "square 2" do
    assert 2 == Grains.square(2)
  end

  test "square 3" do
    assert 4 == Grains.square(3)
  end

  test "square 4" do
    assert 8 == Grains.square(4)
  end

  test "square 16" do
    assert 32768 == Grains.square(16)
  end

  test "square 32" do
    assert 2147483648 == Grains.square(32)
  end

  test "square 64" do
    assert 9223372036854775808 == Grains.square(64)
  end

  test "total grains" do
    assert 18446744073709551615 == Grains.total
  end
end

Add warning about :math.pow to elixir grains
Add warning about :math.pow to elixir grains

IanDCarroll/exercism.io,praveenpuglia/exercism.io,k4rtik/exercism.io,emilyforst/exercism.io,hanumakanthvvn/exercism.io,treiff/exercism.io,RaptorRCX/exercism.io,mscoutermarsh/exercism_coveralls,colinrubbert/exercism.io,Tonkpils/exercism.io,bmulvihill/exercism.io,RaptorRCX/exercism.io,exercistas/exercism.io,copiousfreetime/exercism.io,jtigger/exercism.io,amar47shah/exercism.io,chastell/exercism.io,IanDCarroll/exercism.io,nathanbwright/exercism.io,exercistas/exercism.io,mscoutermarsh/exercism_coveralls,bmulvihill/exercism.io,kangkyu/exercism.io,MBGeoff/Exercism.io-mbgeoff,k4rtik/exercism.io,treiff/exercism.io,sheekap/exercism.io,RaptorRCX/exercism.io,treiff/exercism.io,beni55/exercism.io,tejasbubane/exercism.io,mhelmetag/exercism.io,copiousfreetime/exercism.io,alexclarkofficial/exercism.io,tejasbubane/exercism.io,exercistas/exercism.io,chinaowl/exercism.io,mscoutermarsh/exercism_coveralls,MBGeoff/Exercism.io-mbgeoff,bmulvihill/exercism.io,copiousfreetime/exercism.io,chastell/exercism.io,Tonkpils/exercism.io,sheekap/exercism.io,alexclarkofficial/exercism.io,jtigger/exercism.io,mscoutermarsh/exercism_coveralls,IanDCarroll/exercism.io,praveenpuglia/exercism.io,chinaowl/exercism.io,amar47shah/exercism.io,chastell/exercism.io,kizerxl/exercism.io,mhelmetag/exercism.io,kizerxl/exercism.io,nathanbwright/exercism.io,Tonkpils/exercism.io,hanumakanthvvn/exercism.io,beni55/exercism.io,tejasbubane/exercism.io,treiff/exercism.io,mscoutermarsh/exercism_coveralls,colinrubbert/exercism.io,kizerxl/exercism.io,colinrubbert/exercism.io,praveenpuglia/exercism.io,chinaowl/exercism.io,copiousfreetime/exercism.io,emilyforst/exercism.io,mscoutermarsh/exercism_coveralls,praveenpuglia/exercism.io,beni55/exercism.io,MBGeoff/Exercism.io-mbgeoff,hanumakanthvvn/exercism.io,kangkyu/exercism.io,k4rtik/exercism.io,alexclarkofficial/exercism.io,mhelmetag/exercism.io,sheekap/exercism.io,mscoutermarsh/exercism_coveralls,nathanbwright/exercism.io,bmulvihill/exercism.io,amar47shah/exercism.io,hanumakanthvvn/exercism.io,mhelmetag/exercism.io,mscoutermarsh/exercism_coveralls,nathanbwright/exercism.io,kangkyu/exercism.io,jtigger/exercism.io,jtigger/exercism.io,mscoutermarsh/exercism_coveralls,sheekap/exercism.io,emilyforst/exercism.io,Tonkpils/exercism.io,tejasbubane/exercism.io,RaptorRCX/exercism.io,IanDCarroll/exercism.io,mscoutermarsh/exercism_coveralls