Sign in to follow this  

What the hell !? (EXCEPTION_FLT_INVALID_OPERATION)

This topic is 4852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm geting a EXCEPTION_FLT_INVALID_OPERATION exception. While comparing floats (exact compare):
if((f[lf-2]==a)&&(f[lf-1]==b)) { f[lf++]=c; return lf-3; }
// f is a array of floats. a,b are floats. lf is integer => nothing complex is going on.
and the instruction that triggers the exception:
fcomp dword ptr [ebp+0x0c]
No access violations anywhere (as seen in asm win - the target address is valid and exactly what i wanted to refer to). Intels 2.6GHz HT cpu. Google didn't help :( Any idea ? What could cause it ? And how to prevent it happening ?

Share this post


Link to post
Share on other sites
Yeah, saw that - some sql related stuff - not what i was looking for.

Anyway - after some minutes looking at the exception ... i got a idea:

Not all of the values i'm comparing are actually initialized (se, there is some random crap there) - that IS ok for ME, but NOT for mpu. I bet i did hit a float with the special value that means => 'NOT A FLOAT' => can't compare.

So, for the record: Initialize your floats before using them even if it is unneeded at your side (yeah, belive or not - i DIDN'T need them all to be initialized. LOL).

------------------
Problem solved.

Share this post


Link to post
Share on other sites
Comparing floats: LOL. Yeah, i do know what i'm doing ;)

A EXACT compare was needed. It is part of a code that was searching for a earlier instance of a float vector (no difference allowed). If not present, it gets added. So, '==' was what i needed.

Also, because not always did the vectors need to be initialized fully => garbage got into it. That is completly okay for me ... but ... you know the rest of the story. :)

Share this post


Link to post
Share on other sites

This topic is 4852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this