Skip to content

Instantly share code, notes, and snippets.

@marciol
Created February 26, 2017 02:29
Show Gist options
  • Save marciol/dd612c7906bc4f1e639dceea49f064cd to your computer and use it in GitHub Desktop.
Save marciol/dd612c7906bc4f1e639dceea49f064cd to your computer and use it in GitHub Desktop.
Functional Erlang Mooc
-module(second).
-export([hypotenuse/2, perimeter/2]).
hypotenuse(A, B) ->
AA = first:square(A),
BB = first:square(B),
math:sqrt(AA + BB).
perimeter(A, B) ->
C = hypotenuse(A, B),
A + B + C.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment