Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mimsy!eneevax!umd5!brl-adm!adm!lyle@ads.arpa From: lyle@ads.arpa Newsgroups: comp.lang.c Subject: Complex type ? Message-ID: <7264@brl-adm.ARPA> Date: Wed, 6-May-87 16:17:58 EDT Article-I.D.: brl-adm.7264 Posted: Wed May 6 16:17:58 1987 Date-Received: Fri, 8-May-87 04:15:22 EDT Sender: news@brl-adm.ARPA Lines: 47 C is an evolving language. I will make a possibly sacrilegious suggestion that the type "complex" be incorporated. After all, such a type is now a part of LISP (Common). The purest says:" Well, one can just define a structure complex." (Many years ago I was discussing with a friend the relative utility of FORTRAN and ALGOL for numerical work. I mentioned that ALGOL did not have a type COMPLEX. He said, "Well you can just write a little procedure.") However, the resultant code form using structures and func- tions is much less readable and harder to check. (I have enough trouble with "pow (x,y)" compared with x**y.) ... struct complex { double re; double im; }; { ... struct complex complex_mult(); struct complex A, B, C; struct complex P; P = complex_mult(A, complex_mult(B, C)); ... } One could use a shorter form, such as "cm()" instead of "complex_mult()", but that doesn't really get to the point. P = A * B * C; is more easily read and checked. (I am new to "info-c; perhaps this topic has come up before.)