Signum

, Sign, Sign of, or Direction is a monadic primitive function which returns the sign of a real or complex number. That is, it returns 0 when given an argument of 0, and otherwise returns a number with magnitude 1 given by dividing the argument by its own magnitude.

Examples
The three possible results of Signum on a real argument are,  , and. In dialects with complex numbers, Signum is a somewhat more complicated function, and may return any unit complex number. The result is still equal to the original number divided by its magnitude: The magnitude of the result for a non-zero argument is always 1.

Zero divided by zero
The identity     holds only when   is not zero in most APLs. In "Zero Divided by Zero", Eugene McDonnell gave this identity as a reason to define  to be equal to. In J, which took McDonnell's suggestion, the identity always holds. Dyalog APL and NARS2000 allow the choosing division method though the default remains 1.

Documentation

 * Dyalog
 * APLX
 * J Dictionary, NuVoc