Page History: eval
Compare Page Revisions
Page Revision: 2009/09/19 11:44
eval('expression') - Converts analytic expression to the numeric notation.
SMath uses its symbolic engine and most of the function can be obtained in either
analytic or
numeric notation. Those functions can be evaluated by either symbolic "→" or numeric equal to "=" operators. If the
numeric "=" is used, the result is presented in
floating point notation, but first the expression is calculated symbolicaly. Sometimes this might be very time consuming and the speed of calculation can be reduced drastically. If we need just numerical values,
eval function could be used in order to avoid symbolic calculation, and the calculation speed could be increased significantly.
EXAMPLE:
See the example which uses
eval (see the calculation time).
If you point the particular expression, you will also see the result of symbolic calculation (in the form of tooltip). Compare the
symbolic (tooltip) and
numeric notation (obtained with "=")
Now, compare the calculation time for the same example without
eval. Moreover, pointing on the expression will give the tooltip that the expression is to large to be visualised.
Finally, to clarify this we will simplify the above calculation and we could see how the symbolic calculation could be very comlicated.