Skip to content

Instantly share code, notes, and snippets.

@noname007
Created October 18, 2018 12:34
Show Gist options
  • Save noname007/bf25c7f053d164a833ddfd881741d4e0 to your computer and use it in GitHub Desktop.
Save noname007/bf25c7f053d164a833ddfd881741d4e0 to your computer and use it in GitHub Desktop.
#include
int main() {
double a = 0.58, *aptr = &a;
float af = 0.58, *afptr = ⁡
printf(“%lu,%lx\n”,sizeof(a), *(long int *)aptr);
printf(“%lu,%x\n”,sizeof(af), *(int *)afptr);
// printf(“%lu,%d”,sizeof(a),(int) (a * 100) );
// int b = 21;
// printf(“%lu, %p\n”, sizeof(b), b);
// printf(“%lu, %d\n”, sizeof(b), (int)(float) b);
return 0;
}
@noname007
Copy link
Author

@noname007
Copy link
Author

100.000100000000000332 == 100.000100000000000333 // true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment