Last active
September 27, 2015 23:27
-
-
Save gerdr/1348574 to your computer and use it in GitHub Desktop.
single-precision infinity in C
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 <math.h> | |
/* ANSI fallback, *might* fail on exotic platforms */ | |
#ifndef INFINITY | |
#define INFINITY ((float)HUGE_VAL) | |
#endif | |
#ifndef NAN | |
#define NAN (INFINITY - INFINITY) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment