Skip to content

Commit

Permalink
add a isNaN function for integers
Browse files Browse the repository at this point in the history
 - on some compilers, isnan(int) was not defined and would cause compile
   errors
 - now, isnan(const int) and isnan(const unsigned) return false, which is always
   correct
 - everything is const as ***
  • Loading branch information
slizzered committed Sep 16, 2014
1 parent 95359b8 commit 66e4e81
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@

enum RunMode { NONE, GPU_THREADED, CPU, GPU_MPI };

/**
* @brief this allows the use of isnan() for int
* in the template function fileToVector()
*/
inline bool isnan(const int i){
return false;
}

/**
* @brief this allows the use of isnan() for unsigned
* in the template function fileToVector()
*/
inline bool isnan(const unsigned int i){
return false;
}

/**
* @brief Parses a given file(filename) line by line.
* Each line should contain just one value
Expand Down

0 comments on commit 66e4e81

Please # to comment.