Ask HN: How is it possible to get -0.0 in a sum?

https://news.ycombinator.com/item?id=44767692
by gus_massa • 12 months ago
12 10 12 months ago

I'm looking for corner cases where he result is -0.0. As far as I know, the only way to get -0.0 in a sum is

  (-0.0) + (-0.0)
Does someone know any other case in IEEE 754?

Bonus question: What happens in subtractions? I only know

  (-0.0) - (+0.0)
Is there any other case?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com