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(int) and isnan(unsigned) return false, which is always
   correct
  • Loading branch information
slizzered committed Sep 16, 2014
1 parent 95359b8 commit 1c3dacb
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(int i){
return false;
}

/**
* @brief this allows the use of isnan() for unsigned
* in the template function fileToVector()
*/
inline bool isnan(unsigned 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 1c3dacb

Please # to comment.