fork download
  1. #include <cmath>
  2. #include <iostream>
  3. #include <iomanip>
  4.  
  5. int main(){
  6. long meh = 1e12;
  7. double k = 1e9;
  8. long modr = static_cast<long>(fmod(meh,k));
  9. std::cout << modr << std::endl;
  10. std::cout << std::setprecision(30) << meh << std::endl;
  11. std::cout << std::setprecision(30) << k << std::endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 2684KB
stdin
Standard input is empty
stdout
147483647
2147483647
1000000000