Archived

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

My floats Vars have the Value NAN

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

hi, My Vector class is like the one in OpenGL Game Programming Book. 3 Float Vars. IF all Vars (x,y,z) get all 0.0f the next compiler step all vars have the value nan! SO what can I do?? The vector is no pointer and the vars to! Do you have an idea!?

Share this post


Link to post
Share on other sites
NaN (not a number) is the result of mathematically undefined operations such as 0/0, ∞-∞, ∞/∞

You are probably trying to normalise your vector - which ends up being a division of zero (coordinate) by zero (length) when all the coordinates are null.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites