functions

Functions

All the presented functions are built in. Despite this, they can be redefined by the user. See also the examples of using these functions with scientific, rational, integer, and complex numbers. Read more »

Rules of variables and functions declaring

The function name cannot be the same as the name of a previously declared variable, and vice versa, the name of a new variable should differ from the name of a previously declared function. This concerns built-in and user functions and variables.

Example:

The declared variable is the same as the name of a default function. Therefore, it cannot be accepted.

Example:

The declared function is the same as the name of the previously declared variable. The calculation performs in a fraction.

Remove the variable declaration. Put the cursor as shown in the figure above and press [Del]. Read more »

Basic info

Natural Calculator supports user-defined variables and functions. Thanks to this, the user is not limited by built-in facilities, and there is a possibility to expand them. Any user expression (variable, function, or unit) must be declared before its first use in an expression.

Include files have defined constants that can be used in calculations.

There is a special symbol (hotkey ":") for variables and functions declaration.

Variables are declared as expressions without arguments:

Functions have arguments: Read more »

Main rules

  • Variables or functions must be declared before their first use.
  • Variables or functions can be defined more than once. It is called redefinition.
  • In variable redefinition, the rule of consequence of expressions in the document occurs: the expression uses the variable or function declaration located in the nearest upper position.
  • Redeclaring the function as a variable and vice versa is impossible.
  • Functions can have any number of parameters defined with a comma.
  • Built-in variables and functions can be redefined.
  • Functions can be redefined for any number of arguments.