Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. //check the infinity
  2. double x1=(double)0x7ff0000000000000;
  3. double x2=(double)0x7ff0000000000001; // <=== not the ending 1
  4. printf("nx1=%f, x2=%f sizeof(double) = %d", x1,x2, sizeof(x2));
  5. if(x1==x2)
  6. printf("nx1==x2");
  7. else
  8. printf("nx1!=x2");
  9.  
  10. x1=9218868437227405300.000000, x2=9218868437227405300.000000 sizeof(double) = 8
  11. x1==x2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement