From: Stefan v. d. W. <st...@su...> - 2006-10-11 23:07:28
|
On Wed, Oct 11, 2006 at 03:37:34PM -0600, Fernando Perez wrote: > On 10/11/06, Travis Oliphant <oli...@ee...> wrote: >=20 > > pe...@ce... wrote: > > >Could sqrt(-1) made to return 1j again? > > > > > Not in NumPy. But, in scipy it could. >=20 > Without taking sides on which way to go, I'd like to -1 the idea of a > difference in behavior between numpy and scipy. >=20 > IMHO, scipy should be within reason a strict superset of numpy. > Gratuitious differences in behavior like this one are going to drive > us all mad. >=20 > There are people who import scipy for everything, others distinguish > between numpy and scipy, others use numpy alone and at some point in > their life's code they do >=20 > import numpy as N -> import scipy as N >=20 > because they start needing stuff not in plain numpy. Having different > APIs and behaviors appear there is, I think, a Seriously Bad Idea > (TM). I agree with Fernando on this one. Further, if I understand correctly, changing sqrt and power to give the right answer by default will slow things down somewhat. But is it worth sacrificing intuitive usage for speed? N.power(2,-2) =3D=3D 0 and N.sqrt(-1) =3D=3D nan just doesn't feel right. Why not then have N.power(2,-2) =3D=3D 0.24 N.sqrt(-1) =3D=3D 1j and write a special function that does fast calculation of square-roots for positive values? Cheers St=E9fan |