Re: Is it a bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg17565] Re: Is it a bug?
- From: "David Bailey" <db at salford-software.com>
- Date: Mon, 17 May 1999 02:14:22 -0400
- Organization: University of Salford, Salford, Manchester, UK
- References: <7hgdfs$4bu@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
F. Mittermayr wrote:
> A = {1 + Sqrt[2] I , 1 + 2 * 3 I};
> Cases[A, _Complex]
>
> Out[1] = {1+6 I}
>
> Isn't it a strange result?
It becomes a lot less strange if you examine A with FullForm. If you do that
you will see that Mathematica cannot fully collapse the first expression
because it would have to approximate the square root. One solution is to use
Sqrt[2.0] or N[Sqrt[2]] to produce a floating point result.
David Bailey
Salford Software