Skip to content

Instantly share code, notes, and snippets.

@pppillai
Created May 6, 2020 18:35
Show Gist options
  • Save pppillai/0c63cb08ab9205e6a20c79abb37b9455 to your computer and use it in GitHub Desktop.
Save pppillai/0c63cb08ab9205e6a20c79abb37b9455 to your computer and use it in GitHub Desktop.
-module(first).
-export([double/1, mult/2, area/3, squareValue/1, tripleValue/1]).
mult(X, Y) ->
X * Y.
double(X) ->
mult(X, 2).
area(A, B, C) ->
S = (A + B + C)/2,
math:sqrt(S*(S-A)*(S-B)*(S-C)).
squareValue(X) ->
math:pow(X, 2).
tripleValue(X) ->
squareValue(X) * X.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment