 <p>Try this, if only to be cool xD</p> <pre><code>{ double *to = d; int n=(length+7)/8; switch(length%8){ case 0: do{ *to++ = 0.0; case 7: *to++ = 0.0; case 6: *to++ = 0.0; case 5: *to++ = 0.0; case 4: *to++ = 0.0; case 3: *to++ = 0.0; case 2: *to++ = 0.0; case 1: *to++ = 0.0; }while(--n&gt;0); } } </code></pre>