title: Why Treat 0 as True in Ruby?
body: <p>I'm reading through the excellent <a href="http://ruby.railstutorial.org/" rel="noreferrer">Ruby on Rails Tutorial</a> and have encountered the following code.</p>
  
  <pre><code>if 0
    true
  else
    false
  end
  </code></pre>
  
  <p>The above returns <code>true</code> and illustrates how unlike many languages (C being the obvious example), ruby treats <code>0</code> as <code>true</code>. Rather than dismiss the behavior as idiosyncratic, I assume there is a good reason for this significant departure from convention. Python, for instance, treats <code>0</code> as <code>False</code>, just as one would expect.</p>
  
  <p>In short, what is the rationale in designing ruby to treat <code>0</code> as <code>true</code>?</p>