طريقة Python cmath.isfinite ()
مثال
تحقق مما إذا كانت القيمة المعقدة محدودة أم لا:
#import cmath for complex number operations
import cmath
#find
whether a complex number is finite or not
print (cmath.isfinite(2 + 3j))
print (cmath.isfinite(complex(5.0,float('inf'))))
print
(cmath.isfinite(float('inf')+ 5j))
التعريف والاستخدام
تتحقق الطريقة cmath.isfinite()
مما إذا كانت القيمة المعقدة محدودة أم لا. ترجع هذه الطريقة قيمة منطقية: True
إذا كانت القيمة محدودة ، وإلا False
.
بناء الجملة
cmath.isfinite(x)
قيمه المعامل
Parameter | Description |
---|---|
x | Required. The value to check if it is finite or not |
تفاصيل تقنية
قيمة الإرجاع: | قيمة bool ، True إذا كانت القيمة محدودة ، وإلاFalse |
---|---|
نسخة بايثون: | 3.2 |