Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <limits>
- #include <cmath>
- int main()
- {
- double d;
- if (std::cin >> d) {
- if (fabs(d - int64_t(d)) < std::numeric_limits<double>::epsilon()*fabs(2*d)) {
- std::cout << d << " je cele cislo\n";
- } else {
- std::cout << d << " je realne cislo\n";
- }
- } else {
- std::cout << "Nebylo zadano cislo\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement