2
0

MathExtras.cpp 885 B

1234567891011121314151617181920212223242526272829303132
  1. //===-- MathExtras.cpp - Implement the MathExtras header --------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file implements the MathExtras.h header
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "llvm/Support/MathExtras.h"
  14. #ifdef _MSC_VER
  15. #include <limits>
  16. #else
  17. #include <math.h>
  18. #endif
  19. namespace llvm {
  20. #if defined(_MSC_VER)
  21. // Visual Studio defines the HUGE_VAL class of macros using purposeful
  22. // constant arithmetic overflow, which it then warns on when encountered.
  23. const float huge_valf = std::numeric_limits<float>::infinity();
  24. #else
  25. const float huge_valf = HUGE_VALF;
  26. #endif
  27. }