Skip to content

Instantly share code, notes, and snippets.

@anarsoul
Created January 23, 2020 20:32
Show Gist options
  • Save anarsoul/978e6b188d08ddb60f6aba98a913be32 to your computer and use it in GitHub Desktop.
Save anarsoul/978e6b188d08ddb60f6aba98a913be32 to your computer and use it in GitHub Desktop.
#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