Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Quiet NaN and SNaN in VC++

citrus7citrus7 Member Posts: 2
On win32 platform, the following code results into a QNaN
x = 100 / ( p -q ) // for p == q
Such a code dose not raise any exception during run time on windows platform.
But this code raises the exception on sun4_solaris_64.
While testing I want to disable the QNaN thing so that i can get the exception on win platform.
Can anyone help me out with this?

I am using vc++ 8.0

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : On win32 platform, the following code results into a QNaN
    : x = 100 / ( p -q ) // for p == q
    : Such a code dose not raise any exception during run time on windows
    : platform.
    : But this code raises the exception on sun4_solaris_64.
    : While testing I want to disable the QNaN thing so that i can get the
    : exception on win platform.
    : Can anyone help me out with this?
    :
    : I am using vc++ 8.0
    :
    :

    Check if it's NaN and throw the exception yourself?


    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • citrus7citrus7 Member Posts: 2
    : : On win32 platform, the following code results into a QNaN
    : : x = 100 / ( p -q ) // for p == q
    : : Such a code dose not raise any exception during run time on windows
    : : platform.
    : : But this code raises the exception on sun4_solaris_64.
    : : While testing I want to disable the QNaN thing so that i can get the
    : : exception on win platform.
    : : Can anyone help me out with this?
    : :
    : : I am using vc++ 8.0
    : :
    : :
    :
    : Check if it's NaN and throw the exception yourself?
    :
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry

    I can surely do that in this case, but in code there are many places where this thing happens. I don't want to touch all that code and keep checking for NaN. so I want the conversion to NaN disabled and let the OS throw exception instead.
Sign In or Register to comment.