पायथन गणित। लॉग 2 () विधि
उदाहरण
विभिन्न संख्याओं का आधार-2 लघुगणक ज्ञात कीजिए
# Import math Library
import math
# Return the base-2 logarithm
of different numbers
print(math.log2(2.7183))
print(math.log2(2))
print(math.log2(1))
परिभाषा और उपयोग
यह math.log2()
विधि किसी संख्या का आधार-2 लघुगणक लौटाती है।
वाक्य - विन्यास
math.log2(x)
पैरामीटर मान
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 |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | एक float मान, किसी संख्या के आधार-2 लघुगणक का प्रतिनिधित्व करता है |
---|---|
पायथन संस्करण: | 3.3 |