Skip to content
Prev 33558 / 63424 Next

identical(0, -0)

On Mon, Aug 10, 2009 at 05:47:57AM -0400, Duncan Murdoch wrote:
I think that a logical option "strict" in the above meaning could be
useful for debugging. The default may be FALSE.
On Mon, Aug 10, 2009 at 10:20:39AM -0400, Duncan Murdoch wrote:
[...]

The question, whether 0 and -0 are equal or not, is not clear, since
they have different reciprocals. However, i agree that distinguishing
the signs of zero is rarely useful. From this point of view, the
default FALSE seems to be acceptable.

For completeness, let me also add an argument that it would not be too
harmful, if the default is TRUE. I think that it is quite rare to have
two larger numerical structures, which match up to the last bits in all
numbers, but have a different sign of some zero. Matching all bits
almost requires that the two structures are obtained using the same
expressions for all components. Then, also the signs of zeros will
match. However, i may be wrong.

Petr.