answersLogoWhite

0


Best Answer

Functions basically establish relationships between expressions. Many common Algebraic functions are expressed as functions of x:

f(x) = x2 + 4

Which could also be written as y = x2 + 4

However, this just scratches the tip of the universe. Not only do mathematical functions vary in complexity and offer an infinite number of possibilities, there are also programming functions. Programming functions are typically groups of commands that accept one or more parameters, then return one or more pieces of information.

The above Mathematical function can be re-written as a Perl programming function that accepts a value for x:

sub calculateFunction {

my ($x) = @_;

my $y = x**2 + 4;

return ($y);

}

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is an example of a function?
Write your answer...
Submit
Still have questions?
magnify glass
imp