Python from math import log ... ValueError: math domain error


  • 0
    M

    I've included 'from math import log' and am getting an error with 'math domain error' .. any suggestions?


  • -3
    L

    You can't import anything. Just assume what you need is already there, but if it's not, sorry no one can help you.


  • 1

    Try this on a Python interpreter.

    >> print math.log(10)
    2.30258509299
    >> print math.log(0)
    Line 5: ValueError: math domain error

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.