طريقة Python math.log1p ()
مثال
ابحث عن السجل (1 + رقم) لأرقام مختلفة
# Import math Library
import math
# Return the log(1+number) for different numbers
print(math.log1p(2.7183))
print(math.log1p(2))
print(math.log1p(1))
التعريف والاستخدام
تقوم math.log1p()
الطريقة بإرجاع السجل (1 + رقم) ، محسوبة بطريقة دقيقة حتى عندما تكون قيمة الرقم قريبة من الصفر.
بناء الجملة
math.log1p(x)
قيمه المعامل
Parameter | Description |
---|---|
x | Required. Specifies the number to process. If the value is a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
تفاصيل تقنية
قيمة الإرجاع: | قيمة float تمثل قيمة السجل لرقم 1+ |
---|---|
نسخة بايثون: | 2.6 |