LLVM API Documentation

IsNAN.cpp
Go to the documentation of this file.
00001 //===-- IsNAN.cpp ---------------------------------------------------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // Platform-independent wrapper around C99 isnan().
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "llvm/Config/config.h"
00015 
00016 #if HAVE_ISNAN_IN_MATH_H
00017 # include <math.h>
00018 #elif HAVE_ISNAN_IN_CMATH
00019 # include <cmath>
00020 #elif HAVE_STD_ISNAN_IN_CMATH
00021 # include <cmath>
00022 using std::isnan;
00023 #elif defined(_MSC_VER)
00024 #include <float.h>
00025 #define isnan _isnan
00026 #else
00027 # error "Don't know how to get isnan()"
00028 #endif
00029 
00030 namespace llvm {
00031   int IsNAN(float f)  { return isnan(f); }
00032   int IsNAN(double d) { return isnan(d); }
00033 } // end namespace llvm;