mirror of
https://github.com/g-truc/glm.git
synced 2025-04-07 06:25:00 +00:00
Fixed build
This commit is contained in:
parent
dcf57ab59d
commit
69c764eca9
3 changed files with 19 additions and 19 deletions
|
@ -24,7 +24,7 @@ namespace glm
|
|||
{
|
||||
namespace gtx{
|
||||
//! GLM_GTX_ulp extension: Precision calculation functions
|
||||
namespace spline
|
||||
namespace ulp
|
||||
{
|
||||
/// \addtogroup gtx_ulp
|
||||
///@{
|
||||
|
@ -44,7 +44,7 @@ namespace glm
|
|||
|
||||
#include "ulp.inl"
|
||||
|
||||
namespace glm{using namespace gtx::spline;}
|
||||
namespace glm{using namespace gtx::ulp;}
|
||||
|
||||
#endif//glm_gtx_spline
|
||||
#endif//glm_gtx_ulp
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Created : 2011-03-07
|
||||
// Updated : 2011-03-07
|
||||
// Updated : 2011-04-26
|
||||
// Licence : This source is under MIT License
|
||||
// File : glm/gtx/ulp.inl
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -15,13 +15,13 @@ namespace ulp
|
|||
{
|
||||
inline std::size_t ulp
|
||||
(
|
||||
half const & a,
|
||||
half const & b
|
||||
detail::thalf const & a,
|
||||
detail::thalf const & b
|
||||
)
|
||||
{
|
||||
std::size_t Count = 0;
|
||||
float TempA = a;
|
||||
float TempB = b;
|
||||
float TempA(a);
|
||||
float TempB(b);
|
||||
while((TempA = nextafterf(TempA, TempB)) != TempB)
|
||||
++Count;
|
||||
return Count;
|
||||
|
@ -56,8 +56,8 @@ namespace ulp
|
|||
template <typename T>
|
||||
inline std::size_t ulp
|
||||
(
|
||||
detail::xvec2<T> const & a,
|
||||
detail::xvec2<T> const & b
|
||||
detail::tvec2<T> const & a,
|
||||
detail::tvec2<T> const & b
|
||||
)
|
||||
{
|
||||
std::size_t ulps[] =
|
||||
|
@ -66,14 +66,14 @@ namespace ulp
|
|||
ulp(a[1], b[1])
|
||||
};
|
||||
|
||||
return glm::max(ulps[0], ulps[1])s;
|
||||
return glm::max(ulps[0], ulps[1]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline std::size_t ulp
|
||||
(
|
||||
detail::xvec3<T> const & a,
|
||||
detail::xvec3<T> const & b
|
||||
detail::tvec3<T> const & a,
|
||||
detail::tvec3<T> const & b
|
||||
)
|
||||
{
|
||||
std::size_t ulps[] =
|
||||
|
@ -89,8 +89,8 @@ namespace ulp
|
|||
template <typename T>
|
||||
inline std::size_t ulp
|
||||
(
|
||||
detail::xvec4<T> const & a,
|
||||
detail::xvec4<T> const & b
|
||||
detail::tvec4<T> const & a,
|
||||
detail::tvec4<T> const & b
|
||||
)
|
||||
{
|
||||
std::size_t ulps[] =
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
|
||||
int test_ulp_float()
|
||||
{
|
||||
std::size_t A = ulp(0.01, 0.02);
|
||||
std::size_t B = ulp(glm::vec2(0.01), glm::vec2(0.02));
|
||||
std::size_t C = ulp(glm::vec3(0.01), glm::vec3(0.02));
|
||||
std::size_t D = ulp(glm::vec4(0.01), glm::vec4(0.02));
|
||||
std::size_t A = glm::ulp(0.01, 0.02);
|
||||
std::size_t B = glm::ulp(glm::vec2(0.01), glm::vec2(0.02));
|
||||
std::size_t C = glm::ulp(glm::vec3(0.01), glm::vec3(0.02));
|
||||
std::size_t D = glm::ulp(glm::vec4(0.01), glm::vec4(0.02));
|
||||
std::cout << "glm::ulp test: " << A << std::endl;
|
||||
std::cout << "glm::ulp test: " << B << std::endl;
|
||||
std::cout << "glm::ulp test: " << C << std::endl;
|
||||
|
|
Loading…
Add table
Reference in a new issue