Hacker News new | ask | show | jobs
by sesutton 1932 days ago
Interestingly Go will give you a negative 0 if you use strconv.ParseFloat("-0.0", 64) but I can't see any way to get -0.0 from a number literal.
1 comments

You can't get a negative zero with a constant declaration, nor can you get NaN, infinity. These are documented language facts.

"""Numeric constants represent exact values of arbitrary precision and do not overflow. Consequently, there are no constants denoting the IEEE-754 negative zero, infinity, and not-a-number values."""