+ 2
Print(abs(3+4j))
What does it mean? And how it gives as output 5.0
7 Respostas
+ 8
3+4j is a complex number:
real part = 3
imaginary part = 4
absolute value of complex number (modulus) = sqrt(Re**2 + Im **2):
sqrt(3**2 + 4**2) = sqrt(25) = 5
+ 3
You can use the Pythagoras theorem to determine the modulus/size/absolute value of a complex number.
+ 2
it depends on argument:
for int argument abs() returns int
for float and complex argument it returns float
0
It's a modulus of complex number.
0
Then, what's the function of abs
0
Does abs function return float value