Hi there,

I run the following code in Python 3.3.0 (on a Windows 7 machine) and Python 2.7.3 on a Mac and I get two different results:

result1 = []
result2 = []
for a in range(2,101):
   for b in range(2,101):
       result1.append(math.pow(a,b))
       result2.append(a**b)
result1 = list(set(result1))
result2 = list(set(result2))
print (len(result1))
print (len(result2))

On the Windows box, I get 9183 for on both lines. However, on the Mac I get 9220 and 9183. Why this difference? Is there some sort of precision subtlety I'm missing between ** and math.pow()?

Thank you.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to