fork(1) download
  1. #include <cmath>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. unsigned long long a = 1000ULL ;
  7. unsigned long long b = 10ULL ;
  8. auto res = std::pow( a, b ) ;
  9. std::cout << std::fixed << res << '\n' ;
  10.  
  11. a = 10000000000ULL ;
  12. b = 100000ULL ;
  13. res = std::pow( a, b ) ;
  14. if( res != HUGE_VAL ) std::cout << std::fixed << res << '\n' ;
  15. else std::cout << "overflow\n" ;
  16. }
  17.  
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
1000000000000000019884624838656.000000
overflow