title: How to interpret int to float for range function?
body: <p>I've written a program that calculates the infinite sum series by the formula. I've used a range function to calculate it but I came with a problem that range doesn't work with floats.</p>
  <pre><code>TypeError: 'float' object cannot be interpreted as an integer
  </code></pre>
  <p>I've tried to use <code>numpy.arrange</code> but it helps only when you want to use step <code>arrange(start, stop, STEP)</code>.</p>
  <pre><code>import math
  import numpy
  
  x = float(input('x: '))
  n = float(input('n: '))
  s = 0
    while x &gt;= 0.1:
      for i in range(1, n + 1):
        s = s + (math.pow(-1, i) * math.pow(x, 4 * i + 3)) / (numpy.factorial(2 * i + 1) * (4 * i + 3))
  
  if x &gt;= 1:
      break
  print(s)
  </code></pre>
  <p>UPD: this how my program looks like now:`
  import math
  import numpy</p>
  <pre><code> x = float(input('x: '))
   n = int(input('n: '))
   s = 0
   while x &gt;= 0.1:
    for i in range(1, n + 1):
      s = s + (math.pow(-1, i) * math.pow(x, 4 * i + 3)) / (math.factorial(2 * i + 1) * (4 * i + 3))
  
  if x &gt;= 1:
      break
  print(s)
  </code></pre>
  <p>`
  And such output:</p>
  <pre><code>W:\Labaratorni\Python\lab2_4\venv\Scripts\python.exe 
  W:/Labaratorni/Python/lab2_4/main.py
  x: 0.3
  n: 3
  </code></pre>
  <p>No errors, it just stops.</p>