Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
NaN inside set
//clang 3.8.0 #include <iostream> #include <set> #include <limits> int main() { double nan = std::numeric_limits<double>::quiet_NaN(); std::set<double> s {nan, 1}; auto r = s.find(1); if (r != s.end()) std::cout << "1 is found" << std::endl; else std::cout << "1 is not found" << std::endl; auto p = s.find(2); if (p != s.end()) std::cout << "2 is found" << std::endl; else std::cout << "2 is not found" << std::endl; auto q = s.find(nan); if (q != s.end()) std::cout << "nan is found" << std::endl; else std::cout << "nan is not found" << std::endl; std::cout << "size is " << s.size() << std::endl; std::cout << "contents are :" << std::endl; for (auto i : s) std::cout << i << std::endl; }
run
|
edit
|
history
|
help
0
appliWall
Reverse polish notation
Find in vector vs unordered_map
Throttle Example in C++
insertion sort
Rounding float to nearest 1000 (fixed)
Template arguments may contain calls to constexpr functions.
Pure virtual function called!
Math1
radixSort