How to get the maximum scroll position of a page precisely?
===

If I use the forumla 

**document_height - window_height = max_scroll_position** 

it evaluates to 1 or 0, although I believe it should consistently evaluate to 0. 
For e.g, Open console, Scroll to the bottom of the page on http://stackoverflow.com and do the following on console : 

**($(document).height() - $(window).height()) - $(document).scrollTop()**

I get 1 as the answer (*remember to keep the scroll position to bottom most*)
On jquery.com however, doing the above gives 0

What am I missing ?

