Yes. They are different numbers. In a way, negative zero represents "a
really small negative number" that can't be represented exactly using
floating point.

On Saturday, July 9, 2016, Davide Lasagna <lasagnadav...@gmail.com> wrote:

> Hi,
>
> I have just been bitten by a function hashing a custom type containing a
> vector of floats. It turns out that hashing positive and negative floating
> point zeros returns different hashes.
>
> Demo:
> julia> hash(-0.0)
> 0x3be7d0f7780de548
>
> julia> hash(0.0)
> 0x77cfa1eef01bca90
>
> julia> hash(0)
> 0x77cfa1eef01bca90
>
> Is this expected behaviour?
>
>

Reply via email to