use ceiling instead of casting to get the right number of

steps when the window is inexact