> generates the same output and same assembly
> for both casts.  can anyone explain what this pragma
> is supposed to do?

it changes the rounding mode from the standard
truncate to integer (expensive on a 387) to
round to nearest (incorrect but cheap).

       #pragma fpround on
               print("%d\n", (int)d);
       #pragma fpround 0
               print("%d\n", (int)d);

your examples compiles to the same code in both
cases because the rounding mode is only consulted
during code generation, which happens at the
function's final }.  you'd need to write two different
functions to demonstrate the difference.

russ

Reply via email to