Skip to content

Instantly share code, notes, and snippets.

@DeclanHoare
Created June 23, 2017 13:55
Show Gist options
  • Save DeclanHoare/3b31397a49640c93987a20d2f2d88a6d to your computer and use it in GitHub Desktop.
Save DeclanHoare/3b31397a49640c93987a20d2f2d88a6d to your computer and use it in GitHub Desktop.
map integers to floats...?
#include <stdio.h>
#include <float.h>
#include <stdint.h>
int main(void)
{
for (uint32_t val = 0; val < UINT32_MAX; val++)
printf("%d -> %f\n", val, *((float*)&val));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment