diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-07-08 12:05:44 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-07-08 12:05:44 -0300 |
commit | cc2e40324d884bc0417809980a696a5084e661d7 (patch) | |
tree | 9620dfa32e44af5c125aac2c9bce36011ad27b8b /Project/glm/ext/scalar_ulp.hpp | |
parent | ae765504642759ba4addbf91d62f167ba5f063a3 (diff) | |
download | PSP.git-cc2e40324d884bc0417809980a696a5084e661d7.tar.gz PSP.git-cc2e40324d884bc0417809980a696a5084e661d7.tar.xz PSP.git-cc2e40324d884bc0417809980a696a5084e661d7.zip |
GLM folder changed
Diffstat (limited to 'Project/glm/ext/scalar_ulp.hpp')
-rw-r--r-- | Project/glm/ext/scalar_ulp.hpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Project/glm/ext/scalar_ulp.hpp b/Project/glm/ext/scalar_ulp.hpp new file mode 100644 index 0000000..941ada3 --- /dev/null +++ b/Project/glm/ext/scalar_ulp.hpp @@ -0,0 +1,74 @@ +/// @ref ext_scalar_ulp +/// @file glm/ext/scalar_ulp.hpp +/// +/// @defgroup ext_scalar_ulp GLM_EXT_scalar_ulp +/// @ingroup ext +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. +/// +/// Include <glm/ext/scalar_ulp.hpp> to use the features of this extension. +/// +/// @see ext_vector_ulp +/// @see ext_scalar_relational + +#pragma once + +// Dependencies +#include "../ext/scalar_int_sized.hpp" +#include "../common.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_ulp extension included") +#endif + +namespace glm +{ + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template<typename genType> + GLM_FUNC_DECL genType nextFloat(genType x); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template<typename genType> + GLM_FUNC_DECL genType prevFloat(genType x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template<typename genType> + GLM_FUNC_DECL genType nextFloat(genType x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template<typename genType> + GLM_FUNC_DECL genType prevFloat(genType x, int ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int floatDistance(float x, float y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int64 floatDistance(double x, double y); + + /// @} +}//namespace glm + +#include "scalar_ulp.inl" |