Skip to content

Instantly share code, notes, and snippets.

@mrgame64
Last active August 29, 2015 14:08
Show Gist options
  • Save mrgame64/084b640f9f92d067f056 to your computer and use it in GitHub Desktop.
Save mrgame64/084b640f9f92d067f056 to your computer and use it in GitHub Desktop.
A hack to switch between float and double with just a #define
//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