[Python] Raising a float near 1 to an infinite power in Python

Discussão em 'Python' iniciado por Stack, Março 27, 2025.

  1. Stack

    Stack Membro Participativo

    1.000000000000001 ** float('inf') == float('inf')


    while

    1.0000000000000001 ** float('inf') == 1.0


    What determines the exact threshold here? It seems to be an issue of float precision, where numbers below a certain threshold are considered the same as 1.0. Is there a way to get better precision in Python?

    Continue reading...

Compartilhe esta Página