Не могу понять, чего хочет компилятор на acmp.ru. В чем ошибка? gcc в os x компилирует все нормально. Код:
#include <fstream>
#include <cmath>
using namespace std;
int main(int argc, char* argv[]) {
ifstream fIn("input.txt");
ofstream fOut("output.txt");
double n = 0;
fIn >> n;
fOut << (log(n) / log(2) == floor(log(n) / log(2)) ? "YES" : "NO");
return 0;
}
Ошибки:
task.cpp
task.cpp(10) : error C2668: 'log' : ambiguous call to overloaded function
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\math.h(612): could be 'long
double log(long double)'
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\math.h(564): or 'float log
(float)'
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\math.h(193): or 'double log
(double)'
while trying to match the argument list '(int)'
task.cpp(10) : error C2668: 'log' : ambiguous call to overloaded function
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\math.h(612): could be 'long
double log(long double)'
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\math.h(564): or 'float log
(float)'
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\math.h(193): or 'double log
(double)'
while trying to match the argument list '(int)'