Guest User

Untitled

a guest
Jun 25th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. ccondon@ccondon-VirtualBox:~$ cat test2.c
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. long long x = -4337501956902748161LL;
  6. long long oldx;
  7. double oldd;
  8. while (x < 0L) {
  9. double *d = (double *)&x;
  10. if (*d > (double)x) {
  11. printf("%lld\t%f\n", oldx, oldd);
  12. printf("%lld\t%f\n", x, *d);
  13. return 0;
  14. }
  15. oldd = *d;
  16. oldx = x;
  17. x -= 1LL;
  18. }
  19. }
  20. ccondon@ccondon-VirtualBox:~$ ./a.out
  21. -4337501956902952560 -4337501956902952960.000000
  22. -4337501956902952561 -4337501956902952448.000000
Add Comment
Please, Sign In to add comment