fpclass

fpclass

#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;
}

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today