Sign function (source code)

= Sign function
{title2=$\operatorname{sgn}$}
{wiki}

The sign function records whether a real number is positive or negative, with a convention chosen separately at zero.