Skip to content

Instantly share code, notes, and snippets.

@mikhailramalho
Created October 27, 2016 18:06
Show Gist options
  • Save mikhailramalho/f46051f49a91163a8f81788b3e177e7a to your computer and use it in GitHub Desktop.
Save mikhailramalho/f46051f49a91163a8f81788b3e177e7a to your computer and use it in GitHub Desktop.
#include <math.h>
#include <assert.h>
float nondet();
int main(void)
{
float from = 2.155872e+9f;
union {
float a;
long b;
} from_union = { .a = from };
float new_from = from_union.a;
assert(from == new_from);
}
// 01001111 00000000 01111111 11111111 (from)
// 01001110 10011110 00000001 00000000 (new_from)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment