You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

math_compat.h 548 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef __math_compat_h
  2. #define __math_compat_h
  3. /* Define isnan, isinf, infinity and nan on Windows/MSVC */
  4. #ifndef HAVE_DECL_ISNAN
  5. # ifdef HAVE_DECL__ISNAN
  6. #include <float.h>
  7. #define isnan(x) _isnan(x)
  8. # endif
  9. #endif
  10. #ifndef HAVE_DECL_ISINF
  11. # ifdef HAVE_DECL__FINITE
  12. #include <float.h>
  13. #define isinf(x) (!_finite(x))
  14. # endif
  15. #endif
  16. #ifndef HAVE_DECL_INFINITY
  17. #include <float.h>
  18. #define INFINITY (DBL_MAX + DBL_MAX)
  19. #define HAVE_DECL_INFINITY
  20. #endif
  21. #ifndef HAVE_DECL_NAN
  22. #define NAN (INFINITY - INFINITY)
  23. #define HAVE_DECL_NAN
  24. #endif
  25. #endif