[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SIGNUM and brain damage



I'm probably guilty here, if guilt there be.  Floating-point contagion
may have been the disease, but remember also that Common Lisp adopted
the APL extension to SIGNUM, namely that SIGNUM of a complex number
returns that point on the unit circle on the ray from the origin to
the argument (or zero if the argument is zero).  That lent more impetus
to following the usual contagion rules (both floating and complex).
It also allows the following fairly elegant definition:
	(defun signum (x) (if (zerop x) x (/ x (abs x))))
--Guy