title: Can One Decrease Overall Accuracy in Python?
body: <p>I'm making a program to calculate primes, and I look at the remainder of the possible prime I'm testing and all the primes I have so far, but stop if I get to the point where I am comparing the PossPrime to anything above its square root. (I can explain this if needed).  I don't care about any digits after the decimal point of the sqrt; is there a way to tell Python not to bother calculating those?  </p>
  
  <p>And, is there a way to integrate that aspect (only testing the primes under it until I get to the sqrt) into the <code>for</code> loop?</p>
  
  <pre><code>  #There's some boring setup before here that isn't problematic.
  while True:
      PossWasDivis = False  #initialize the var (used to convey if the possible prime was divis)
  
      sqrtP = int(sqrt(PossPrime))
      for iterationOfArray in range(2, sqrtP):
  
         # print ("Comparing: (", PossPrime, "% (", GlobPrimeList [iterationOfArray],")) == 0")
          if (PossPrime % (GlobPrimeList [iterationOfArray])) == 0:
         #     print(PossPrime, "was divisable by", GlobPrimeList[iterationOfArray],"!  Breaking for loop")
              PossWasDivis = True
              break
          if (GlobPrimeList [iterationOfArray]) &gt; sqrtP:
              break
  
      if PossWasDivis == False:    # Occurs when none of the tested #s are divis
          GlobPrimeList.append (PossPrime)
          f.write(str(PossPrime)+'\n')
  
      #Switch between incramenting PossPrime between 2 and 4
      if PossPrimeStat == 2:
          PossPrimeStat = 4
          PossPrime += 4
      else:                 # if PossPrimeStat == 4:
          PossPrimeStat = 2
          PossPrime += 2
  </code></pre>
  
  <p>The GlobPrimeList has some primes preloaded in it to start out with and continues finding more indefinitely until I cancel the program.</p>