Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> writes: > Have I got this right? Is there a way to work out the gap between one > float and the next?
Yes, 53-bit mantissa as people have mentioned. That tells you what ints can be exactly represented. But, arithmetic in some situations can have a 1-ulp error. So I wonder if it's possible that if n is large enough, you might have something like n+1==n even if the integers n and n+1 have distinct floating point representations. -- http://mail.python.org/mailman/listinfo/python-list