fpclass

fpclass

Imagen de Community Admin

#include
#include

Why does this program output 40 == _FPCLASS_PZ
According to IEEE it should be _FPCLASS_QNAN
and that is also what VC7 produces.

int main () {
double zero = 0.0;
double inf = 1.0 / zero;
double nan = 0.0 * inf;

std::cout << std::hex << _fpclass(nan) << std::endl;

return 0;
}

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Hi,

Could you kindly tell me what options you used to build the program?
Is this with /Op or not? (/Op[-] improve floating-pt consistency)

Thanks,
Ganesh

Imagen de Community Admin

Hi Ganesh,

Thanks a lot. That solves the problem. Is there
any documentation about this, and the pro&cons ?
I mean what is the impact of this option?
Doesit result in less performant code?
Is this option really good in practice (and
then why is it not the default?).

We detected this "problem" in the testsuite
of our product, but on a rather artificial
example.

thanks again,

andreas

Inicie sesión para dejar un comentario.