fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <limits>
  4.  
  5. int main()
  6. {
  7. double myval = 3.1;
  8. double first = 0;
  9.  
  10. double second = std::modf(myval, &first);
  11.  
  12. std::cout<<first<<" and "<<second * 10<<"\n";
  13. return 0;
  14. }
Success #stdin #stdout 0s 3344KB
stdin
Standard input is empty
stdout
3 and 1