Look at this section of the program, meets the control word that wouldn't be conversion, should how to write?
Int Log2_I2I (int value, BOOL roundUp)
{
WORD TMPCW tmprnddowncw;
If (roundUp)
Tmprnddowncw=0;
The else
Tmprnddowncw=0 x0400;
_asm
{
FNSTCW TMPCW//set the control word to round to on the down
Mov ax, TMPCW
And ax, 0 xf3ff
The or tmprnddowncw, ax
Fld1
Fild value
Fyl2x
Fistp value
FLDCW TMPCW//restore control word
}
return value;
}
CodePudding user response:
First, the function of the function?CodePudding user response:
http://blog.csdn.net/shile/article/details/51198482