Archived

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

glnefugio

My floats Vars have the Value NAN

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