Edit

Here's a function to round a floating point number down to the next integer smaller than or equal to the argument.

floor function |

Here's a function that returns a matrix. I didn't say it was a useful function.

funny matrix function |

As one could see function is defined by its name and arguments given in parenthesis like:

On the LHS of the assignment operator there is

Besides variables, function can have another function as an argument. Here is an example:

function as function argument |

Edit

Edit

common mistake |

Explanation: The common mistake shown above is avoided if the function is defined first. The variables should be assigned to their desired values only after the function is defined. Smath (like Mathcad) calculates from the top-left corner towards the bottom-right corner of the worksheet; therefore, if a variable is defined and then a function is defined using that variable, Smath defines the new function using the previously assigned VALUE of the variable. Changing the variable lower on the worksheet cannot redefine the function because the function was defined higher up on the worksheet. Therefore, if the user wants to be able to edit variable values used within a function, the function must be defined first using previously UNDEFINED variables and then the variables can be defined (and redefined as many times as desired) lower down on the worksheet. See graphic below for correct usage:

correct usage |

Edit

Functions can have the same name |

Edit

Reserved words? |

Redefining SMath function - take care! |

Edit

Scalar? Matrix? arguments |

Edit

Using for loop |

Edit

To deactivate this feature one should press F8 button again or press ESC + several ways implemented to deactivate it automatically (on click, if cursor will jump to another element and etc.).

Here is how it looks like: