title: How to get the maximum scroll position of a page precisely?
body: <p>If I use the formula </p>
  
  <pre><code>document_height - window_height = max_scroll_position
  </code></pre>
  
  <p>It evaluates to 1 or 0, although I believe it should consistently evaluate to 0. 
  For e.g, <strong>on firefox</strong> Open console, Scroll to the bottom of the page on <a href="http://stackoverflow.com">http://stackoverflow.com</a> and do the following on console : </p>
  
  <pre><code>($(document).height() - $(window).height()) - $(document).scrollTop()
  </code></pre>
  
  <p>I get 1 as the answer (<em>remember to keep the scroll position to bottom most</em>)
  On jquery.com however, doing the above gives 0</p>
  
  <p>What am I missing ?</p>