Mathematical functions have a specific meaning. For math function,
that are built-in a language, these functions
generally correspond to our idea of a math function:
values are sent to a function and it returns a value.
Computer functions are built-in, provided in an additional library, or user-supplied.
The trend today is to talk about functions as opposed to subroutines.
The rules for a function in a computer language may vary to quite an extent.
In general, a computer function returns a value, but this is not
always the case. [Interestingly, in some languages functions return a value
even if you do not tell them to do so and, at the same time,
you do not need to use that value.]
In computer "lingo" we often talk about arguments and parameters. Function calls
have "arguments" and function definitions have parameters.
Over the years we have come to "expect" that a function
will not have a side-effect.
That is, a function will return a value but it will not change any value sent to it or any value outside of it.
This is not always the case. [An example of where this might not apply would be a sort
function. We might send it a list of items and expect the sort
function to return the list sorted. In some languages the belief that a function should not have side effects
gives rise to having the sort function return a sorted list of values, but not
change the argument list.
In that situation one would call the sort function
and assign its return value to the original list,
if that is what you wanted to do.]
There is also an expectation that a function will not need any value that is
not sent to it via an argument-parameter match. This expectation, too, is not
met in some situations.
Care must be taken with mathematical functions to be sure that
you are using the correct units. Thus, while we might understand the sin(30°)
most built-in sin() functions expect the argument to be given in radians.
There is no list of universally available math functions. Each
computer language defines its own. Care should be taken to be sure that you
understand how the language you are using defines its functions.
Take the limits on the range of functions seriously. Sending a function
an argument outside of that range may produce unexpected results, or even no result.