Hmmm, did you read the whole blog post, including the update at the end?
Julia does handle signed zeroes correctly when working with floats.

As to what signed zeros "mean" -- they have some applications, including
indicating the direction of underflow. Probably you don't need to worry
about them much since 0.0 == -0.0 (unless you specifically want to use
them).

I usually think about -0.0 as equivalent to 0.0 except for +, -, *, and
/, especially when Inf is involved. Thinking about it as some limit is
not very intuitive for IEEE floats, eg

julia> log(-0.0)
-Inf

julia> sqrt(-0.0)
-0.0

all of which are correct IEEE.

Best,

Tamas


On Fri, Dec 19 2014, cdm <[email protected]> wrote:

> i stumbled across a post and got to wondering what Julians thought of it ...
>
>   http://www.walkingrandomly.com/?p=5152
>
>
> the author presents the case that Python is not IEEE compliant, but
> MATLAB is and Julia is close:
>
> "From the wikipedia page on Division by Zero
> <http://en.wikipedia.org/wiki/Division_by_zero>: *“The IEEE 754
> standard specifies that every floating point arithmetic operation,
> including division by zero, has a well-defined result”.*
>
>
> the author reports that in Julia
>
> julia> 1/(-0)
> Inf
>
>
> but MATLAB "correctly" returns -Inf ...
>
>
> i am not sure that signed zero (-0)
> means anything to me ...
>
> should it?
>
> many thanks,
>
> cdm

Reply via email to