Created
January 23, 2020 20:32
-
-
Save anarsoul/978e6b188d08ddb60f6aba98a913be32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
union u { | |
int i; | |
float f; | |
}; | |
int main(void) | |
{ | |
union u test, test2, res; | |
test.i = 4; | |
test2.f = 1.0f; | |
res.f = test.f * test2.f; | |
printf("%f %.8x\n", res.f, res.i); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment