[Python] OverflowError: long int too large to convert to float in python

Discussão em 'Python' iniciado por Stack, Julho 6, 2025.

  1. Stack

    Stack Membro Participativo

    I tried to calculate poisson distribution in python as below:

    p = math.pow(3,idx)
    depart = math.exp(-3) * p
    depart = depart / math.factorial(idx)


    idx ranges from 0

    But I got OverflowError: long int too large to convert to float

    I tried to convert depart to float but no results.

    Continue reading...

Compartilhe esta Página