title: Ruby: How to check for negative zero
body: <p>How can I find out if a <code>Float</code> value is a negative zero (and not a positive one)?</p>
  
  <p>Unfortunately:</p>
  
  <pre><code>-0.0 == 0.0   # =&gt; true
  -0.0 === 0.0  # =&gt; true
  </code></pre>
  
  <p>My initial solution works but is ugly:</p>
  
  <pre><code>x.to_s == '-0.0' 
  </code></pre>
  
  <p>From <a href="https://stackoverflow.com/questions/22409102/how-do-i-check-if-a-zero-is-positive-or-negative">this question</a>, I found</p>
  
  <pre><code>x == 0 and 1 / x &lt; 0
  </code></pre>
  
  <p>Is there a better, more Ruby-like way? </p>