How can I simplify this code snippet?
<p>I have a method that 'steps' from a start to an end value, which works perfectly well and ignores steps that are either infinite or that already fails the condition. But the only different is <code>&gt;=</code> vs <code>&lt;=</code> if the step is negative. I've tried what feels like everything with no luck. Show me the magic.</p>

<pre><code> if (step &lt; 0)
 {
    while(start &gt;= endpoint)
    {
       // use start here
       start += step;
    }
 } 
 else 
 {
    while(start &lt;= endpoint)
    {
       // use start here
       start += step;
    }
 }
</code></pre>
