PyWart: Language missing maximum constant of numeric types!
steve+comp.lang.python at pearwood.info
Fri Feb 24 23:45:53 CET 2012
On Fri, 24 Feb 2012 09:23:08 -0700, Michael Torrie wrote:
> All this reminds me of the original cray supercomputers. They didn't
> use twos compliment for integers so they had two representations of zero
> (+0 and -0). Made programming a bit tricky.
While there is only one integer zero, I would like to point out that in
floating point, there are usually two zeroes, -0.0 and +0.0, and that
this is by design and a feature, not an accident or a bug.
Well-written floating point functions should keep the sign when they
py> 1e-200 * 1e-200
py> 1e-200 * -1e-200
and well-written functions should honour those separate zeroes because
sometimes it makes a difference.
More information about the Python-list