title: How do I find the largest integer less than x?
body: <p>If <code>x</code> is <code>2.3</code>, then <code>math.floor(x)</code> returns <code>2.0</code>, the largest integer smaller than or equal to <code>x</code> (as a float.)</p>
  
  <p>How would I get <code>i</code> the largest integer <em>strictly</em> smaller than <code>x</code> (as a integer)?</p>
  
  <p>The best I came up with is:</p>
  
  <pre><code>i = int(math.ceil(x)-1)
  </code></pre>
  
  <p>Is there a better way?</p>
  
  <p>Note, that if <code>x</code> is <code>2.0</code> then <code>math.floor(x)</code> returns <code>2.0</code> but I need the largest integer smaller than <code>2.0</code>, which is <code>1</code>.</p>