Documentation moved.
This entry is now part of the unified function reference. Open the unified page →
Function
src/index.ts:807nerdamer.heaviside
nerdamer.heaviside(x: Expression): ExpressionComputes the Heaviside step function (unit step function). Uses the half-maximum convention at the origin: -
`heaviside(x) = 0`for
`x < 0`-
`heaviside(0) = 1/2`-
`heaviside(x) = 1`for
`x > 0`For symbolic inputs, returns an unevaluated
`heaviside(x)`node.
Parameters
| Name | Type | Description |
|---|---|---|
x | Expression | The input expression. |
Returns
Expression — The Heaviside step value.
Examples
heaviside(Expression.create(3)).text() // "1"
heaviside(Expression.create(-2)).text() // "0"
heaviside(Expression.create(0)).text() // "1/2"
heaviside(Expression.create('t')).text() // "heaviside(t)"