regarding e^(i*pi)+1
Title
Question
e^(%pi*%i)+1
ans =
2.
i am getting the answer as 2 but correct answer is 0.
Please help and thanks in advance.
Scilab Getting-Started 13-14 min 10-20 sec
Answers:
e^(%pi*%i)+1 will not get evaluated in scilab because for scilab "e" is just another variable. The correct way to define "e" is by using %e expression. Hence %e^(%pi*%i)+1 will work and give the output "1.225D-16i" which says the real part is 0 and the imaginary part is 1.225*10^(-16). Other way to compute exponents is to use the "exp()" expression. Hence the same computation can be done using exp(%pi*%i)+1 and will give same results.
Login to add comment