Function reference · Math

rect

Computes a unit-width rectangular pulse centered at zero.

rect(x) is 1 when |x|<1/2, 1/2 when |x|=1/2, and 0 when |x|>1/2. Unresolved symbolic inputs remain as rect(x).

Examples

These examples use Nerdamer Notation.

Evaluate at the center of the pulse.

rect(0)
// → 1

Use the half-height value at the boundary.

rect(1/2)
// → 1/2

Return zero outside the pulse.

rect(3/4)
// → 0

Keep an unresolved symbolic input unevaluated.

rect(x)
// → rect(x)

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

rect(arg1)

nerdamer.rect

Call the operation through the default nerdamer import.

nerdamer.rect(x: ExpressionInput): Expression

Parameters

NameTypeDescription
xExpressionInput—

Returns

Expression

Browse the nerdamer API →

← Back to Function reference