Algosim documentation: rect

rect

The rectangle function.

Syntax

Description

The rectangle function is defined by

          ⎧ 0   if |x| > 0.5
rect(x) = ⎨ .5  if |x| = 0.5
          ⎩ 1   if |x| < 0.5.

Notes

If you use the rectangle function frequently, you may want to assign it to Π or some other brief identifier. (Notice that Π (GREEK CAPITAL LETTER PI) will not conflict with (N-ARY PRODUCT).)

Π ≔ rect

See also