fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double part, d = 123.456, frac = modf(d,&part);
  5. printf("%f %f %f",d,part,frac);
  6.  
  7. return 0;
  8. }
  9.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
123.456000 123.000000 0.456000