fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. cout << abs(2);
  7. }
Compilation error #stdin compilation error #stdout 0s 2740KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:6: error: call of overloaded 'abs(int)' is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
stdout
Standard output is empty