Guest User

Untitled

a guest
Jan 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #include <math.h>
  2. #include <stdio.h>
  3. #include <sys/time.h>
  4.  
  5. int main(int argc, char *argv[]) {
  6. double v;
  7. struct timeval t;
  8.  
  9. gettimeofday(&t, NULL);
  10. v = t.tv_sec;
  11. printf("v = %f - cos = %f - sin = %f\n", v, cos(v), sin(v));
  12. v = 123;
  13. printf("v = %f - cos = %f - sin = %f\n", v, cos(v), sin(v));
  14. v = 123456;
  15. printf("v = %f - cos = %f - sin = %f\n", v, cos(v), sin(v));
  16. v = 1234567890;
  17. printf("v = %f - cos = %f - sin = %f\n", v, cos(v), sin(v));
  18. v = 210828714.0;
  19. printf("v = %f - cos = %f - sin = %f\n", v, cos(v), sin(v));
  20. v = 210828715.0;
  21. printf("v = %f - cos = %f - sin = %f\n", v, cos(v), sin(v));
  22. return 0;
  23. }
  24.  
  25. ## Output
  26. v = 1317025570.000000 - cos = 1317025570.000000 - sin = 1317025570.000000
  27. v = 123.000000 - cos = -0.887969 - sin = -0.459903
  28. v = 123456.000000 - cos = -0.672295 - sin = -0.740283
  29. v = 1234567890.000000 - cos = 1234567890.000000 - sin = 1234567890.000000
  30. v = 210828714.000000 - cos = 210828714.000000 - sin = -0.132763
  31. v = 210828715.000000 - cos = 210828715.000000 - sin = 210828715.000000
Add Comment
Please, Sign In to add comment