Synopsis
This operator can be used to calculate new macros (from existing ones).
Description
This operator constructs new macros from expressions which might also use already existing macros. The names of the new macros and their construction description are defined in the parameter list "functions".
The following operators are supported:
- Addition: +
- Subtraction: -
- Multiplication: *
- Division: /
- Power: ^
- Modulus: %
- Less Than: <
- Greater Than: >
- Less or Equal: <=
- More or Equal: >=
- Equal: ==
- Not Equal: !=
- Boolean Not: !
- Boolean And: two ampers and
- Boolean Or: ||
The following log and exponential functions are supported:
- Natural Logarithm: ln(x)
- Logarithm Base 10: log(x)
- Logarithm Dualis (Base 2): ld(x)
- Exponential (e^x): exp(x)
- Power: pow(x,y)
The following trigonometric functions are supported:
- Sine: sin(x)
- Cosine: cos(x)
- Tangent: tan(x)
- Arc Sine: asin(x)
- Arc Cosine: acos(x)
- Arc Tangent: atan(x)
- Arc Tangent (with 2 parameters): atan2(x,y)
- Hyperbolic Sine: sinh(x)
- Hyperbolic Cosine: cosh(x)
- Hyperbolic Tangent: tanh(x)
- Inverse Hyperbolic Sine: asinh(x)
- Inverse Hyperbolic Cosine: acosh(x)
- Inverse Hyperbolic Tangent: atanh(x)
The following statistical functions are supported:
- Round: round(x)
- Round to p decimals: round(x,p)
- Floor: floor(x)
- Ceiling: ceil(x)
The following miscellaneous functions are supported:
- Average: avg(x,y,z...)
- Minimum: min(x,y,z...)
- Maximum: max(x,y,z...)
The following miscellaneous functions are supported:
- If-Then-Else: if(cond,true-evaluation, false-evaluation)
- Absolute: abs(x)
- Square Root: sqrt(x)
- Signum (delivers the sign of a number): sgn(x)
- Random Number (between 0 and 1): rand()
- Modulus (x % y): mod(x,y)
- Sum of k Numbers: sum(x,y,z...)
- Binomial Coefficients: binom(n, i)
- Number to String: str(x)
Beside those operators and functions, this operator also supports the constants pi and e if this is indicated by the corresponding parameter (default: true). You can also use strings in formulas (for example in a conditioned if-formula) but the string values have to be enclosed in double quotes.
Please note that there are some restrictions for the usage of other macros. The values of used macros have to fulfill the following in order to let this operator work properly:
- If the standard constants are usable, macro values with names like "e" or "pi" are not allowed.
- Macro values with function or operator names are also not allowed.
- Macro values containing parentheses are not allowed.
Examples: 17+sin(%{macro1}*%{macro2}) if (%macro1}>5, %{macro2}*%{macro3}, -abs(%{macro4}))
Input
- through 1:
Output
- through 1:
Parameters
- function descriptions: The list of macro names together with the expressions which define the new macros
- use standard constants: Indicates if standard constants like e or pi should be available.