MathFunction Block
Applies a mathematical function to the input signal: exp, log, pow, round, floor, ceil, etc.
Open MathFunction in BlockWerk →# Math Function Block
Description
Applies a selectable mathematical function to the input signal. Supports exponential, logarithmic, power, remainder, and rounding operations.
Mathematical Model
y = f(u) where f is one of: exp, log, log10, pow(u,n), rem(u,n), round, floor, ceil.
Parameters
function
Select which mathematical function to apply.
constant
Used by pow (exponent) and rem (divisor). Ignored by other functions.
Domain Restrictions
| Function | Valid input domain | Out-of-domain behavior | |----------|-------------------|----------------------| | exp | any real | May overflow for large inputs | | log | x > 0 | Returns -∞ for x ≤ 0 | | log10 | x > 0 | Returns -∞ for x ≤ 0 | | pow | any (see notes) | NaN for negative base with non-integer exponent | | rem | any | Returns 0 if divisor |constant| < 1e-6 | | round | any | Standard rounding (0.5 rounds to even) | | floor | any | Always valid | | ceil | any | Always valid |
Remarks
- log/log10: Returns -infinity for non-positive inputs (no NaN propagation).
- rem: Returns 0 if constant magnitude is less than 1e-6 (division protection). The threshold is intentionally larger than machine epsilon to avoid floating-point issues.
- pow: Supports fractional exponents (e.g., 0.5 for square root). Negative bases with non-integer exponents produce NaN.
- Unknown function: Produces NaN output to signal configuration error. Check the function parameter spelling.
See Also
- Trigonometric: For sin, cos, tan operations
- SquareRoot: Dedicated nth-root block
- Gain: For simple multiplication by constant