# Why the first one works fine but not the second one?

Why the first one works fine but not the second one? How can I make it work?

1. Abs[#] Exp[I Arg[#]] &@(1 + I)
2. Abs[#] Exp[I Arg[#]] &@(1.1 + I)

You can see why when you break it up. Since you use 1.1 then Mathematica evaluated it numerically.

Compare

v = 1 + I
a = Abs[v]
b = Exp[I Arg[v]]
a*b


With

v = 1.10 + I
a = Abs[v]
b = Exp[I Arg[v]]
a*b


You see that Exp[I Arg[v]] now is 0.73994 + 0.672673 I

To keep things nice, as your first example, use exact number

v = 11/10 + I
a = Abs[v]
b = Exp[I Arg[v]]
a*b


And now it gives

You see it kept Exp[I Arg[v]] as E^(I ArcTan[10/11]) and not 0.73994 + 0.672673 I as before, since the number is now exact.

I tend to avoid inexact numbers, unless I am doing numerical computation and using functions such as NDSolve and NIntegrate and such, then it is OK.

You can always at the very end of the calculation, convert things to numerical values using N function. This gives more accurate results also.

• I would request you to modify the title of this post as you see fit.
– Syed
Oct 9, 2021 at 6:54
• @Syed I assume you meant to ask the OP about this and not me? As I am not the one who asked the question ;) Oct 9, 2021 at 6:59
• No, I think that since you have answered the post convincingly, it is only appropriate that you edit the title to make it useful for future web searches. Thanks.
– Syed
Oct 9, 2021 at 7:01
• @Syed sorry, I do not feel comfortable changing titles of questions of others. But feel free to ask the OP or the site moderator to do this if you want. If you have enough rep, you can also do that yourself if you wish. Oct 9, 2021 at 7:04