I think it works just fine. Did you miss the namespace std?
#include <cmath> #include <iostream> int main() { std::cout << "sqrt(2) = " << std::sqrt(2.0) << std::endl; return 0; }