Created
May 5, 2020 19:33
-
-
Save danielribes/ccd58cd86706a35f102268c9bb24c154 to your computer and use it in GitHub Desktop.
Functional Programming in Erlang The University of Kent - Activity 1.9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Functional Programming in Erlang | |
-module(first). | |
-export([double/1,mult/2,area/3,treble/1,square/1]). | |
mult(X,Y) -> | |
X*Y. | |
double(X) -> | |
mult(2,X). | |
area(A,B,C) -> | |
S = (A+B+C)/2, | |
math:sqrt(S*(S-A)*(S-B)*(S-C)). | |
%% | |
%% Functional Programming in Erlang | |
%% Activity 1.9 | |
%% | |
treble(A) -> | |
A*3. | |
square(A) -> | |
A*A. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment