fork download
  1. #include <stdio.h>
  2.  
  3. struct Arr2 { int data[2]; };
  4.  
  5. struct Arr2 foo(double x) {
  6. struct Arr2 r;
  7. r.data[0] = x;
  8. r.data[1] = (x - r.data[0]) * 1000000;
  9. return r;
  10. }
  11.  
  12. int main(void) {
  13. struct Arr2 split;
  14. split = foo(3.14159);
  15. printf("%d + 0.%06d\n", split.data[0], split.data[1]);
  16. return 0;
  17. }
Success #stdin #stdout 0s 4508KB
stdin
Standard input is empty
stdout
3 + 0.141589