From: Alan G I. <ai...@am...> - 2006-10-12 14:51:50
|
On Thu, 12 Oct 2006, Stefan van der Walt apparently wrote:=20 > I tried to explain the argument at=20 > http://www.scipy.org/NegativeSquareRoot=20 Helpful. But you start off by saying: In mathematics, the above assumption is true -- that=20 the square root of -1 is 1j. Since square root is (here) a function, and part of the=20 function definition is the domain and codomain, this=20 statement is not correct. If the codomain is real numbers,=20 the domain must correspondingly be (a subset of) the=20 nonnegative reals. The nan output is the result of an=20 **invalid** input. So the question is really: "Why is a negative real number an=20 invalid input in this implementation", or "Why in this=20 implementation is the type of the output restricted by the=20 type of the input?" You get a good start on answering that. Cheers, Alan Isaac |