how can I check if the number is float point number without converting the number to string and then find '.'? For example, this number (5.0) should not be integer. I found the following way in Python but it didn't work in C++
abs(n - (int)n) < 0.000001
Sorry for being not clear enough. I want to implement a function (template function) that accepts a number and returns true if the number is integer otherwise returns false.
There is no need to use either function. The correct way is to either use std::is_integral, or if your compiler/library does not support C++11, to use the boost equivalent.