12345678910111213141516171819202122232425262728 |
- -module(first).
- -export([double/1,
- treble/1,
- mult/2,
- square/1,
- area/3]).
- mult(X,Y) ->
- X*Y.
- double(X) ->
- mult(2,X).
- treble(X) ->
- mult(3,X).
- area(A,B,C) ->
- S = (A+B+C)/2,
- math:sqrt(S*(S-A)*(S-B)*(S-C)).
- square(X) ->
- mult(X, X).
|