Skip to content

Commit

Permalink
Merge pull request #46 from tmdiv/devel
Browse files Browse the repository at this point in the history
Fix missing isnan in Visual C++ (relates to #23)
  • Loading branch information
Armin Hornung committed Sep 5, 2013
2 parents c5d2003 + 45e4305 commit e90a56a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion octomap/src/compare_octrees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@
#include <list>
#include <cmath>

#ifdef _MSC_VER
#define isnan(x) _isnan(x) //for VC++
#endif

using std::cout;
using std::endl;
using namespace std;
using namespace octomap;

void printUsage(char* self){
Expand Down Expand Up @@ -127,7 +132,7 @@ int main(int argc, char** argv) {
else
kld +=log(p1/p2)*p1 + log((1-p1)/(1-p2))*(1-p1);

if (std::isnan(kld)){
if (isnan(kld)){
OCTOMAP_ERROR("KLD is nan! KLD(%f,%f)=%f; sum = %f", p1, p2, kld, kld_sum);
exit(-1);
}
Expand Down

0 comments on commit e90a56a

Please sign in to comment.