Last active
August 29, 2015 14:08
-
-
Save mrgame64/084b640f9f92d067f056 to your computer and use it in GitHub Desktop.
A hack to switch between float and double with just a #define
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
//uncomment the line below to use 'double', or else leave it commented to use 'float' | |
//#define DOUBLE_PREC | |
#ifdef DOUBLE_PREC | |
typedef double fp; | |
#else | |
typedef float fp; | |
#endif | |
//use 'fp' instead of 'float' or 'double' in your code | |
//unless you want the precision to be fixed in some cases |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment