z******i 发帖数: 59 | 1 It is a truncation. You can write a simple C code, and check its
assemly to figure out what it is doing. X86 has the fistpl (convert float to
integer) instruction to do that.
But be careful if performance is important in your code. Since the
conversion
is very slow (stall FPU due to fldcw - load FPU control word).
146 80483ee: d9 6d e4 fldcw -0x1c(%ebp)
147 80483f1: db 5d f4 fistpl -0xc(%ebp)
148 80483f4: d9 6d e6 fldcw -0x1a(%ebp)
int to |
|