I've been experimenting with namespaces. Everything has gone well, and in the process a problem jumped out: when I try to get the foo namespace function to work-->return pow(a , b) in foo.h I get garbage values. If I use normal math functions that don't require additional header files, it works fine. To declare pow(a,b) the program needs math.h but I'm not having luck positioning it.
These approaches are not ideal, mostly for learning.
main.cpp
I'm not @ne555, but he was showing you that you are calculating an extremely large number. 4^50 fits into a 64-bit int, butdoes not fit into a 32-bit int. Your system apparently uses a 32-bit int, and since the double value you are calculating is so large, the resultant int value is garbage.