9
3

scalar_constants.inl 710 B

123456789101112131415161718192021222324
  1. #include <limits>
  2. namespace glm
  3. {
  4. template<typename genType>
  5. GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon()
  6. {
  7. GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'epsilon' only accepts floating-point inputs");
  8. return std::numeric_limits<genType>::epsilon();
  9. }
  10. template<typename genType>
  11. GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi()
  12. {
  13. GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'pi' only accepts floating-point inputs");
  14. return static_cast<genType>(3.14159265358979323846264338327950288);
  15. }
  16. template<typename genType>
  17. GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two()
  18. {
  19. return genType(0.877582561890372716130286068203503191);
  20. }
  21. } //namespace glm