Error Handling and Function Returns

Error 40 (Incorrect call to routine) is raised if either the wrong number of arguments or incorrect data is passed to a function.

If a mathematical function fails, the function will return nan, +infinity, and -infinity as appropriate. These returns are consistent on all operating systems.

Where an error occurs, the variable MATHERRNO is set with additional information that further defines the source of the error.