So what you are seeing are rounding errors
#include <iostream>
#include <cmath>
std::cout<<std::pow(10,4);
int p=std::pow(10,4);
std::cout<<p;
Oh, just noticed that without std:: it calls the C library version, makes sense. But why they give different result?You should ask it the compiler developers.