Function: heaviside (x)
Function: heaviside (x, zero_value)

Compute the Heaviside unit-step function.

The Heaviside function is 0 for negative x and 1 for positive x.

Example:

heaviside([-inf -3 -1 1 3 inf])
  ⇒ 0     0     0     1     1     1

There are various conventions for heaviside(0); this function returns 0.5 by default:

heaviside(0)
  ⇒ 0.5000

However, this can be changed via the optional second input argument:

heaviside(0, 1)
  ⇒ 1

See also: dirac, @sym/heaviside.

Package: symbolic