طريقة Python cmath.sqrt ()
مثال
أوجد الجذر التربيعي لعدد مركب:
#Import cmath Library
import cmath
#Return the square root of a
complex number
print (cmath.sqrt(2 + 3j))
print (cmath.sqrt(15))
التعريف والاستخدام
تُرجع cmath.sqrt()
الطريقة الجذر التربيعي لعدد مركب.
ملاحظة: يجب أن يكون الرقم أكبر من أو يساوي 0.
بناء الجملة
cmath.sqrt(x)
قيمه المعامل
Parameter | Description |
---|---|
x | Required. A number to find the square root of. If the number is less than 0, it returns a ValueError. If the value is not a number, it returns a TypeError |
تفاصيل تقنية
قيمة الإرجاع: | قيمة complex تمثل الجذر التربيعي لعدد مركب |
---|---|
نسخة بايثون: | 1.5 |