1*91d3cfedSDuncan P. N. Exon Smith //===-- MathExtras.cpp - Implement the MathExtras header --------------===// 27b4133acSYaron Keren // 37b4133acSYaron Keren // The LLVM Compiler Infrastructure 47b4133acSYaron Keren // 57b4133acSYaron Keren // This file is distributed under the University of Illinois Open Source 67b4133acSYaron Keren // License. See LICENSE.TXT for details. 77b4133acSYaron Keren // 87b4133acSYaron Keren //===----------------------------------------------------------------------===// 97b4133acSYaron Keren // 107b4133acSYaron Keren // This file implements the MathExtras.h header 117b4133acSYaron Keren // 127b4133acSYaron Keren //===----------------------------------------------------------------------===// 137b4133acSYaron Keren 147b4133acSYaron Keren #include "llvm/Support/MathExtras.h" 157b4133acSYaron Keren 167b4133acSYaron Keren #ifdef _MSC_VER 177b4133acSYaron Keren #include <limits> 187b4133acSYaron Keren #else 19*91d3cfedSDuncan P. N. Exon Smith #include <math.h> 207b4133acSYaron Keren #endif 217b4133acSYaron Keren 227b4133acSYaron Keren namespace llvm { 237b4133acSYaron Keren 247b4133acSYaron Keren #if defined(_MSC_VER) 257b4133acSYaron Keren // Visual Studio defines the HUGE_VAL class of macros using purposeful 267b4133acSYaron Keren // constant arithmetic overflow, which it then warns on when encountered. 277b4133acSYaron Keren const float huge_valf = std::numeric_limits<float>::infinity(); 287b4133acSYaron Keren #else 297b4133acSYaron Keren const float huge_valf = HUGE_VALF; 307b4133acSYaron Keren #endif 317b4133acSYaron Keren 32*91d3cfedSDuncan P. N. Exon Smith } 33