19 yo student *and* a full-time developer.
Building with Rails currently, exploring new frontiers.
I enjoy functional programming, Linux, FOSS, refactoring and mentoring :)
defmoduleDay78TestdouseExUnit.CaseimportDay78,only:[proper_fractions:1]test"1/1 is improper"doassertproper_fractions(1)==0endtest"2/1 is proper"doassertproper_fractions(2)==1endtest"other common cases"doassertproper_fractions(5)==4assertproper_fractions(15)==8assertproper_fractions(25)==20endtest"works only with positive numbers"doassert_raiseFunctionClauseError,fn->proper_fractions(0)endassert_raiseFunctionClauseError,fn->proper_fractions(-1)endendend
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Elixir:
Tests: