signum -package:bv

Sign of a number. The functions abs and signum should satisfy the law:
abs x * signum x == x
For real numbers, the signum is either -1 (negative), 0 (zero) or 1 (positive).
Scale a complex number to magnitude 1. For a complex number z, abs z is a number with the magnitude of z, but oriented in the positive real direction, whereas signum z has the phase of z, but unit magnitude.
Determine the 'sign' of a value.
The sign of a number.
>>> signum (-1)
-1
abs zero == zero, so any value for signum zero is ok. We choose lawful neutral:
>>> signum zero == zero
True
Takes the sign of a Quantity. The functions abs and signum satisy the law that:
abs x * signum x == x
The sign is either negate _1 (negative), _0 (zero), or _1 (positive).
Signum.
sign
Used to implement signum for the Num typeclass. This gives 1 for a positive integer, and -1 for a negative integer.

Example

>>> signumInteger 5
1
>>> signum 5
1
Return -1, 0, and 1 depending on whether argument is negative, zero, or positive, respectively
Apply signum to each element of the array
Op for signum
signum over the Int type lifted over the Expr type.
> signum' xx'
signum x' :: Int
> evl (signum' minusTwo) :: Int
-1
signum over the Int type encoded as an Expr.
> signumE
signum :: Int -> Int
Construct and internalizing a SignumNumTerm.
Compute signum of a decimal, always one of 1, 0 or -1
Compute signum of a decimal, always one of 1, 0 or -1