title: float division by zero Python
body: <p>I,m trying to divide a number by other which is tiny. "q" is always a float number between 0 and 1 and when n is over 1000, output says "float division by zero" because it rounds the small number to zero. I have tryed with Decimal but still not working</p>
  
  <pre><code>#Librerías
  import numpy as np
  import matplotlib.pyplot as plt
  from decimal import Decimal
  
  #Datos
  p = float(input("Introduzca probabilidad de error de bit: "))
  while p &lt; 0 or p &gt; 1:
      p = float(input("Introduzca probabilidad de error de bit: "))
  n = int(input("Introduzca número de bits: "))
  while n &lt; 0:
      n = int(input("Introduzca número de bits: "))
  
  #Cálculos
  q = 1-p
  pexito = (q**n)
  intentos = 1/pexito
  print()
  print("El número medio de intentos es:",intentos)
  print()
  print("La probabilidad de transmitir correctamente",n,"bits es:",pexito)
  
  
  
  ZeroDivisionError                         Traceback (most recent call last)
  &lt;ipython-input-10-606e023fc7ec&gt; in &lt;module&gt;
       15 q = 1-p
       16 pexito = (q**n)
  ---&gt; 17 intentos = 1/pexito
       18 print()
       19 print("El número medio de intentos es:",intentos)
  
  ZeroDivisionError: float division by zero
  </code></pre>