Created
November 8, 2015 03:58
-
-
Save warmwaffles/3f145c338563efb09e0c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <stdint.h> | |
| #include <string.h> | |
| uint32_t float_to_raw_bits(float x) | |
| { | |
| uint32_t y; | |
| memcpy(&y, &x, 4); | |
| return y; | |
| } | |
| uint64_t double_to_raw_bits(double x) | |
| { | |
| uint64_t y; | |
| memcpy(&y, &x, 8); | |
| return y; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment