[Python] Exponentials in python: x**y vs math.pow(x, y)

Discussão em 'Python' iniciado por Stack, Agosto 3, 2025.

  1. Stack

    Stack Membro Participativo

    Which one is more efficient using math.pow or the ** operator? When should I use one over the other?

    So far I know that x**y can return an int or a float if you use a decimal the function pow will return a float

    import math

    print( math.pow(10, 2) )

    print( 10. ** 2 )

    Continue reading...

Compartilhe esta Página