Function reference · Math

rect

Returns a rectangular pulse of width 1 centered at 0.

It is 1 inside the pulse (|x|<1/2), 1/2 at its edges and 0 outside. For a symbol, the call is returned unevaluated.

Notation

rect(x)

Write it in an expression: nerdamer('rect(0)'), or in the Playground.

nerdamer.rect

nerdamer.rect(x: ExpressionInput): Expression

A method on the default import. Arguments can be strings, as in Notation.

Examples

The center.

rect(0)
// → 1
Open in Playground

An edge is 1/2.

rect(1/2)
// → 1/2
Open in Playground

Outside the pulse.

rect(3/4)
// → 0
Open in Playground

A symbol: unevaluated.

rect(x)
// → rect(x)
Open in Playground

← Back to Function reference