पायथन गणित। लॉग () विधि
उदाहरण
विभिन्न संख्याओं का प्राकृतिक लघुगणक ज्ञात कीजिए
# Import math Library
import math
# Return the natural logarithm
of different numbers
print(math.log(2.7183))
print(math.log(2))
print(math.log(1))
परिभाषा और उपयोग
यह math.log()
विधि किसी संख्या का प्राकृतिक लघुगणक या आधार पर संख्या का लघुगणक लौटाती है।
वाक्य - विन्यास
math.log(x, base)
पैरामीटर मान
Parameter | Description |
---|---|
x | Required. Specifies the value to calculate the logarithm for. If the value is 0 or a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
base | Optional. The logarithmic base to use. Default is 'e' |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | एक float मान, किसी संख्या का प्राकृतिक लघुगणक, या आधार से संख्या का लघुगणक का प्रतिनिधित्व करता है |
---|---|
पायथन संस्करण: | संस्करण 2.3 . में बदला गया |
लॉग बदलें: | आधार पैरामीटर जोड़ा गया था |