Answer the question
In order to leave comments, you need to log in
How to disable extended precision mode for FPU from DLL?
Hello.
I am maintaining a dll (msvc 2008 + qt4) which is being used by another application. Apparently this application switches the FPU to extended precision mode, so QLocale::toString starts to work incorrectly.
Example (see bugreport https://bugreports.qt.io/browse/QTBUG-13509):
// QLocale::toString is used inside QString::number
qDebug() << QString::number(1951.0); // 1951
// switch FPU to extended precision mode
__asm
{
FNINIT
sub esp,2
mov word ptr [esp],037Fh ; ensure precision control is extended, and exception masks set.
fldcw [esp]
add esp,2
}
qDebug() << QString::number(1951.0); // 1950.:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question