I assume you mean floating point numbers. The way they are represented in most computer languages you can have small roundoff errors in the last bit. You have to compare them in narrow range, example:
pi1 = 355/113.0
print pi1 # 3.14159292035
pi2 = 3.14159
delta = 0.00003
# compare within narrow range
if (pi2 + delta) > pi1 > (pi2 - delta):
print 'close enough'
Python also has high accuracy module decimal avoiding round off errors.
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
Offline 1,422 posts
since Jul 2005