IsNAN.cpp revision 193323
1193323Sed//===-- IsNAN.cpp ---------------------------------------------------------===// 2193323Sed// 3193323Sed// The LLVM Compiler Infrastructure 4193323Sed// 5193323Sed// This file is distributed under the University of Illinois Open Source 6193323Sed// License. See LICENSE.TXT for details. 7193323Sed// 8193323Sed//===----------------------------------------------------------------------===// 9193323Sed// 10193323Sed// Platform-independent wrapper around C99 isnan(). 11193323Sed// 12193323Sed//===----------------------------------------------------------------------===// 13193323Sed 14193323Sed#include "llvm/Config/config.h" 15193323Sed 16193323Sed#if HAVE_ISNAN_IN_MATH_H 17193323Sed# include <math.h> 18193323Sed#elif HAVE_ISNAN_IN_CMATH 19193323Sed# include <cmath> 20193323Sed#elif HAVE_STD_ISNAN_IN_CMATH 21193323Sed# include <cmath> 22193323Sedusing std::isnan; 23193323Sed#elif defined(_MSC_VER) 24193323Sed#include <float.h> 25193323Sed#define isnan _isnan 26193323Sed#else 27193323Sed# error "Don't know how to get isnan()" 28193323Sed#endif 29193323Sed 30193323Sednamespace llvm { 31193323Sed int IsNAN(float f) { return isnan(f); } 32193323Sed int IsNAN(double d) { return isnan(d); } 33193323Sed} // end namespace llvm; 34