Re: Is it a bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg17691] Re: Is it a bug?
- From: Allan Hayes <hay at haystack.demon.co.uk>
- Date: Fri, 21 May 1999 23:59:05 -0400
- References: <37393190.0@webpc1.vai.co.at> <7i34k1$bej@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
F. Mittermayr <mitterma at linz.vai.co.at> wrote in message news:7i34k1$bej at smc.vnet.net... > Thanks to all who have told me that it is not a strange result. --------- Snip ---------- > > x = Sqrt[I]-1/Sqrt[2](1+I); > Cases[{x, x//FullSimplify},_Integer] > Out[]= {0} > > It cannot be that a number becomes an integer by doing a "FullSimplify". > Shouldn't the text in the online-help be changed to the following: > > ----------Snip------------ > Franz, Transfer the simplification to the test: x = Sqrt[I] - 1/Sqrt[2]*(1 + I); g = (1 + Sqrt[5])/2; Cases[{x, x, (a + 1)/(a + 1), (a^2 + a)/a - a, (g^9 - (-g)^(-9))/Sqrt[5]}, _?(Head[FullSimplify[#1]] === Integer & ) ] {(-1)^(1/4) - (1 + I)/Sqrt[2], (-1)^(1/4) - (1 + I)/Sqrt[2], 1, -a + (a + a^2)/a, (-(512/(-1 - Sqrt[5])^9) + 1/512*(1 + Sqrt[5])^9)/Sqrt[5]} {(-1)^(1/4) - (1 + I)/Sqrt[2], 1, -a + (a + a^2)/a} > It cannot be that a number becomes an integer by doing a "FullSimplify". > Shouldn't the text in the online-help be changed to the following: Right, but some are only recognizable as equal to an integer (having head Integer) after simplification > Why doesn't Mathematica do any calculation on the expression x = > Sqrt[I]-1/Sqrt[2](1+I); A common complaint is that Mathematica is too eager to evaluate - sometimes we don't want to simplify - and it would slow some calculations down a lot if Simplify or FullSimplify were used on all subexpressions. Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565