Article View: comp.lang.oberon
Article #1302Re: Why no Complex Arithmetic ?
From: Jean-Pierre Weber
Date: Tue, 09 Apr 1996 11:58
Date: Tue, 09 Apr 1996 11:58
46 lines
2786 bytes
2786 bytes
Peter Froelich wrote: [snip] > All books on (practical) numerical mathematics that I've come across do > fine with REAL. > >AFAIK (please correct me) not even the various *-XDS languages by Kuchling >et.al. have a COMPLEX type, even it they were specifically tailored for >numerics (exact rounding in an interval arithmethic). > > Although a complex type seems pleasing, I'm not yet convinced that it >really would cause a lot of algorithms to be converted to actually using >COMPLEX instead of REAL. Please give me an example algorithm that >*seriously* benefits from a COMPLEX type. [snip] > _ >By(T)e... /| _ //3000 /\ People who use Pascal for serious programming |\ > Peter... \| \X/\miga \/ fall into a fatal trap. (Brian W. Kernighan) |/ Well, I am working mainly in integrated optics and quantum electronics. Nearly all the equations in this field use complex numbers. You can do it using reals, but this complicates things a lot. Being able to express my equations and algorithms directly using a complex type would simplify my program writing a lot. And your argument about people not using complex in numerical analysis books is irrelevant. These books are concerned with maximum speed and efficiency. I will trade a 30 % slowdown on execution for a 100 % speedup on writing my programs (especially since my execution times are typically a few seconds up to a a minute). Thus, while it may be true that a complex type is not always the best solution, there are a lot of situations when the gain in legibility and writing speed of the program more than justifies the slight loss of execution speed. This is exactly the same trade-off as when one uses a high-level language versus assembly code. Jean-Pierre --- =========================================================================== | Jean-Pierre Weber | We do | | Fiber Optics Research Center | Phone: +46 8 757 4513 | \|/ | | Ericsson Components AB | Fax: +46 8 757 4764 | ----O- | | KI/EKA/N/SF | e-mail: ekajewe@eka.ericsson.se | /|\ | | S-164 81 KISTA , SWEDEN | MEMO: ERI.EKA.EKAJEWE | lasers | ===========================================================================
Technical Details
Message-ID:
<4kdjcb$9h3@erinews.ericsson.se>Path:
arc1-ca.pugleaf.net!erinews.ericsson.se!usenetReferences:
<225BC72BH00088B82H@p.froehlich.amc.cube.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!erinews.ericsson.se!usenet From: ekajewe@eka.ericsson.se (Jean-Pierre Weber) Newsgroups: comp.lang.oberon Subject: Re: Why no Complex Arithmetic ? Date: 9 Apr 1996 11:58:03 GMT Organization: Ericsson Components AB Distribution: world Message-ID: <4kdjcb$9h3@erinews.ericsson.se> References: <225BC72BH00088B82H@p.froehlich.amc.cube.net> Reply-To: ekajewe@eka.ericsson.se NNTP-Posting-Host: forc12.eka.ericsson.se