Assembly or ....

Barry Margolin barmar at think.COM
Thu Dec 1 02:45:54 AEST 1988


In article <771 at quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
>In fact, if we define SIGN(x) = if x = 0 then 0 else x/ABS(x), you can
>extend DIV and MOD to the complex numbers as well, not that it's quite
>as useful...

Which is, in fact, precisely how Common Lisp (which has complex and
rational numbers built in) defines SIGNUM.  This definition computes
the unit vector colinear with the vector in the complex plane that the
original number specifies.

Barry Margolin
Thinking Machines Corp.

barmar at think.com
{uunet,harvard}!think!barmar



More information about the Comp.lang.c mailing list