@vncpetrov/

DivisionOperator3

C++

No description

fork
loading
Files
  • main.cpp

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.723515863724524","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgaW50IGEgPSAxNTsKICBjb3V0IDw8IGEgLyAyLjAgPDwgZW5kbDsgICAgLy8g0JTRgNC+0LHQtdC9INGA0LXQt9GD0LvRgtCw0YI6IDcuNQogIGNvdXQgPDwgYSAvIDAuMCA8PCBlbmRsOyAgICAvLyDQoNC10LfRg9C70YLQsNGCOiBpbmYKICBjb3V0IDw8IC1hIC8gMC4wIDw8IGVuZGw7ICAgLy8g0KDQtdC30YPQu9GC0LDRgjogLWluZgogIGNvdXQgPDwgMC4wIC8gMC4wIDw8IGVuZGw7ICAvLyDQoNC10LfRg9C70YLQsNGCOiAtbmFuKE5vdCBhIE51bWJlciksINGCLtC1LiDRgNC10LfRg9C70YLQsNGC0YrRggogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyDQvtGCINC+0L/QtdGA0LDRhtC40Y/RgtCwINC90LUg0LUg0LLQsNC70LjQtNC90LAg0YfQuNGB0LvQtdC90LAg0YHRgtC+0LnQvdC+0YHRggp9"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
using namespace std;

int main() {
  int a = 15;
  cout << a / 2.0 << endl;    // Дробен резултат: 7.5
  cout << a / 0.0 << endl;    // Резултат: inf
  cout << -a / 0.0 << endl;   // Резултат: -inf
  cout << 0.0 / 0.0 << endl;  // Резултат: -nan(Not a Number), т.е. резултатът
                              // от операцията не е валидна числена стойност
}