fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. unsigned long long x1n = 0x7ff0000000000000ULL; // Inf
  6. double x1 = *((double*)&x1n);
  7. unsigned long long x2n = 0x7ff0000000000001ULL; // Signaling NaN
  8. double x2 = *((double*)&x2n);
  9.  
  10. printf("\nx1=%f, x2=%f sizeof(double) = %d", x1, x2, sizeof(x2));
  11. if (x1 == x2)
  12. printf("\nx1==x2");
  13. else
  14. printf("\nx1!=x2"); // x1 != x2
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
x1=inf, x2=nan sizeof(double) = 8
x1!=x2