Created
May 6, 2020 14:18
-
-
Save Joakineee/ffcd33d6543aca37819c227a85042e35 to your computer and use it in GitHub Desktop.
My first Erlang program
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
-module(first). | |
-export([double/1,mult/2,area/3,square/1,treble/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)). | |
square(X) -> | |
X*X. | |
treble(X) -> | |
X*X*X. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment