Box2D Forums

It is currently Sun May 19, 2013 5:56 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jul 29, 2008 6:05 pm 
Offline

Joined: Tue Jul 29, 2008 5:59 pm
Posts: 20
here is the function.

Code:
inline bool b2IsValid(float32 x)
{
#ifdef _MSC_VER
     return _finite(x) != 0;
#else
    if( x == FP_NAN || x == FP_INFINITE ) // my example numbers are 1 and 2 and they make this if statement true;
        return false;
    else
        return true;
    //return finite(x) != 0;


i commented out this and just return true for now and my physics game loads fine. this is not properly checking if the floating point is Not a Number or is Infinite.


Top
 Profile  
 
PostPosted: Tue Jul 29, 2008 7:36 pm 
Offline

Joined: Wed Jan 02, 2008 3:19 am
Posts: 67
The values FP_NAN and FP_FINITE are enumerated constants not in the floating point number space. To use them you would compare fpclassify(x) == FP_NAN. What is in the SVN source right now is to use finite(x) for non-microsoft compilers and _finite(x) for microsoft compilers. Perhaps your compiler needs to use some other function?


Top
 Profile  
 
PostPosted: Thu Jul 31, 2008 3:02 pm 
Offline

Joined: Tue Jul 29, 2008 5:59 pm
Posts: 20
oh, alright, i will look into that. we are compiling for the iphone.

thx for the help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group