From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA24841; Wed, 28 Mar 2001 09:48:40 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA24837 for ; Wed, 28 Mar 2001 09:48:40 +0200 (MET DST) Received: from smtp2.ihug.co.nz (smtp2.ihug.co.nz [203.109.252.8]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2S7mXP21841 for ; Wed, 28 Mar 2001 09:48:38 +0200 (MET DST) Received: from [192.168.0.12] (p34-max10.wlg.ihug.co.nz [203.173.232.98]) by smtp2.ihug.co.nz (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id TAA07228; Wed, 28 Mar 2001 19:48:20 +1200 X-Authentication-Warning: smtp2.ihug.co.nz: Host p34-max10.wlg.ihug.co.nz [203.173.232.98] claimed to be [192.168.0.12] Mime-Version: 1.0 X-Sender: bruce@209.163.245.148 Message-Id: In-Reply-To: <002701c0b757$aefbcff0$210148bf@dylan> References: <002701c0b757$aefbcff0$210148bf@dylan> Date: Wed, 28 Mar 2001 19:47:46 +1200 To: "David McClain" , From: Bruce Hoult Subject: Re: [Caml-list] Complex Arithmetic Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk At 12:21 AM -0700 3/28/01, David McClain wrote: >Borda's Mouthpiece requires taking the square root of the square of values >along the negative imaginary axis. When you square (0 - 1i) you get (-1). >...but actually you get (-1 + 0-). Most languages simply accept the square >as (-1) = (-1 + 0+). > >Taking the subsequent square root when you have made this incorrect >assumption gives the value sqrt(-1) -> (0+1i). And so the stream line mapped >from the negative imaginary axis ends up cutting across all the other stream >lines when this condition is encountered. An obvious error! > >The correct answer is obtained by noting that (0 - 1i)^2 -> (-1 + 0-) and >sqrt(-1 + 0-) -> (0 -1i) again. Only by properly considering the nature of >floating point zero (i.e., which of the two you really have) can you perform >this computation correctly. I guess I'm just dense, but I don't see how you generalize this. I mean, OK, if you want to also say that (-1, 0)^2 -> (1, 0-) so that you can then do sqrt(1, 0-) -> (-1, 0) instead of (1, 0) then I guess I could live with this. But how do you deal with all the other complementary pairs? I mean, how do you distinguish the results of, say (4 + 5i)^2 and (-4 - 5i)^2 -- both of which are (-9 + 40i) -- so that when you do sqrt(-9 + 40i) you get the number you started with rather than always the principle one? I'm afraid I just don't see it. -- Bruce ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr