Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

jonbell

Float Bug

This topic is 5249 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

Advertisement
indeterminate floatng point value.

google for a detailed description.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
quote:
Original post by jonbell
I have a strange bug, one of my vectors keeps getting its x,y,z set to -1.#INDO

What is #INDO ?


Probably your debugger (you are using debug version) is alerting you that you have not initialized the variables; the debug version usually fill memory/variable with deafult values.
It''s not a bug but it can be a problem if you use your vector without init.

Share this post


Link to post
Share on other sites
The values are correct until some bug occurs and then they become -1.INDO

What can cause a valid floating point value to be set to this? Am i correct in thinking that it does not have a value of -1 rather its value is undefined?

Share this post


Link to post
Share on other sites
quote:
Original post by jonbell
The values are correct until some bug occurs and then they become -1.INDO

What can cause a valid floating point value to be set to this? Am i correct in thinking that it does not have a value of -1 rather its value is undefined?


See also division by zero!

Share this post


Link to post
Share on other sites
No i don''t get a crash so its not div by 0. I am seeing the values in the debugger but it is very difficult to get a breakpoint when the values get screwed cause i can''t test for -1.#indo

Anyone know what this value means and what can cause it?

Share this post


Link to post
Share on other sites
did you even consider my reply?

it stands for indeterminate float value. it can be caused by various operations (i.e. infinity * infinity, 0 * infinity, etc). it means the result cannot be determined.

ieeefloat

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
quote:
Original post by jonbell
No i don''t get a crash so its not div by 0. I am seeing the values in the debugger but it is very difficult to get a breakpoint when the values get screwed cause i can''t test for -1.#indo

Anyone know what this value means and what can cause it?


Floating point divisions by zero do not crash (only integer divisions do), they yield either +infinity, -infinity or NaN (Not a Number), which is precisely what you got here : you made, somewhere, an operation that doesn''t make sense mathematically (for real numbers) such as 0/0, infinity/infinity, infinity-infinity, square root of a negative number, arc-cosine of a number not in [-1,1], etc.

Share this post


Link to post
Share on other sites
fruny: teach a man to fish....

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
Actually, floating point dbz''s raise an exception, but floating point exceptions are masked by default on MSVC and many other compilers. Borland products (notably Delphi and C-builder) don''t mask them and will break the program.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!