<br><br><div><span class="gmail_quote">On 8/4/07, <b class="gmail_sendername">Dan Piponi</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 8/4/07, Albert Y. C. Lai <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:<br>> There is no reason to expect complex ** to agree with real **.<br><br>There's every reason. It is standard mathematical practice to embed
<br>the integers in the rationals in the reals in the complex numbers and<br>it is nice to have as many functions as possible respect that<br>embedding. </blockquote><div><br>A example I have seen before that illustrates some the difficulties with preserving such behaviour is (-1)^(1/3).
<br><br>Of course, taking the nth root is multi-valued, so if you're to return a single value, you must choose a convention. Many implementations I have seen choose the solution with lowest argument (i.e. the first solution encounted by a counterclockwise sweep through the plane starting at (1,0).)
<br><br>With this interpretation, (-1)^(1/3) = 0.5 + sqrt(3)/2 * i. If you go with the real solution (-1) you might need to do so carefully in order to preserve other useful properties of ^, like continuity.<br><br>Steve