Created
June 23, 2017 13:55
-
-
Save DeclanHoare/3b31397a49640c93987a20d2f2d88a6d to your computer and use it in GitHub Desktop.
map integers to floats...?
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> | |
#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