Entrypoints' effect may call functions. A function returns a value, may fail, but cannot change the contract storage.
A function is declared with the
function keyword followed by a unique identifier, the returned type and the function body. The function body cannot include assignment instructions on storage elements, nor it can invoke the
transfer instruction; it uses the
return keyword to return a value.
For example, the following function implements the Horner's formula of the exponential function:
The Michelson representation of a function is a lambda expression put on the stack.