# Box2D Forums

 It is currently Sat May 18, 2013 10:36 am

 All times are UTC - 8 hours [ DST ]

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Bug: b2Math.h : b2IsValid(float32 x)Posted: Tue Jul 29, 2008 6:05 pm

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

 Post subject: Re: Bug: b2Math.h : b2IsValid(float32 x)Posted: Tue Jul 29, 2008 7:36 pm

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

 Post subject: Re: Bug: b2Math.h : b2IsValid(float32 x)Posted: Thu Jul 31, 2008 3:02 pm

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 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 forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

 Search for: