log()

log(x,y) returns log of input number x with base y (optional ) . If y is not given then e ( What is e ? ) is used as base.
import math
print(math.log(2))   # 0.6931471805599453
With different base
import math
print(math.log(2,3))  # 0.6309297535714574
print(math.log(4,5))  # 0.8613531161467861
Using negative number
For any value less than or equal to 0 , we will get ValueError
import math
print(math.log(-2))
print(math.log(0))
Above code will generate error.

log(x)/log(y) is same as log(x,y). Check this code.
import math
x=2
y=4
print(math.log(x))              #  0.6931471805599453
print(math.log(y))              #  1.3862943611198906
print(math.log(x,y))            # 0.5
print(math.log(x)/math.log(y))  # 0.5 
log10 modf()
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    05-02-2023

    X,Y on the same axis overlapping; however each carries its own width and length

    Post your comments , suggestion , error , requirements etc here





    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer