Utility Functions

Utility functions

LazySets.sign_cadlagFunction.
sign_cadlag(x::N)::N where {N<:Real}

This function works like the sign function but is $1$ for input $0$.

Input

  • x – real scalar

Output

$1$ if $x ≥ 0$, $-1$ otherwise.

Notes

This is the sign function right-continuous at zero (see càdlàg function). It can be used with vector-valued arguments via the dot operator.

Examples

julia> sign_cadlag.([-0.6, 1.3, 0.0])
3-element Array{Float64,1}:
 -1.0
  1.0
  1.0
source