Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ccondon@ccondon-VirtualBox:~$ cat test2.c
- #include <stdio.h>
- int main() {
- long long x = -4337501956902748161LL;
- long long oldx;
- double oldd;
- while (x < 0L) {
- double *d = (double *)&x;
- if (*d > (double)x) {
- printf("%lld\t%f\n", oldx, oldd);
- printf("%lld\t%f\n", x, *d);
- return 0;
- }
- oldd = *d;
- oldx = x;
- x -= 1LL;
- }
- }
- ccondon@ccondon-VirtualBox:~$ ./a.out
- -4337501956902952560 -4337501956902952960.000000
- -4337501956902952561 -4337501956902952448.000000
Add Comment
Please, Sign In to add comment