Complex Head
- To: mathgroup at smc.vnet.net
- Subject: [mg17614] Complex Head
- From: Jack Goldberg <jackgold at math.lsa.umich.edu>
- Date: Tue, 18 May 1999 02:45:17 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi Group: See mg[7605], mg[7548] and mg[7592]. The issue here is why does the following occur: Head[Sqrt[2]*I] -> Times while Head[2*I] -> Complex At the risk of being shot down and stripped of my medals from Mathematica, I offer this explanation. The answer seems to depend on how far Mathematica goes in determining the properties of x in an expression like x*I. For example, Mathematica will simplify automatically x = Exp[Pi*I] to -1 and thus Head[x*I] -> Complex But the kernel will not take the time to decide that Sqrt[2] is real. Moreover, since x could be quite complicated, say some value of the Bessel function, it is probably impossible to decide on the correct value of "Head" for every Mathematica-ly sound numerical choice of x. Indeed, it may be that x has a value for which no known algorithm determines whether it is real or complex! Add to this the requirement that Head[...] must always return something, we have an answer to Mittermayr's question. Jack