Compiler optimizations

Craig Black cblack at ara.com
Sun Apr 30 10:36:43 PDT 2006


If you want to get a direct comparison between floating point and integer
division, then use

> > int divTest2(double divisor, int total)
> > {
> >   int sum = 0;
> >   for(int i = 0; i < total; i++)
> >   {
> >     int quotient = i / divisor; // !!!!!!!!
> >     sum += quotient;
> >   }
> > }





More information about the Digitalmars-d mailing list