Skip to content

Commit

Permalink
Fixed glm::log2<int>() returns wrong value, missing static assert g-t…
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed Sep 20, 2017
1 parent 5606dd1 commit 1bf24f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 2 additions & 0 deletions glm/detail/func_exponential.inl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'log2' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");

return detail::functor1<L, T, T, Q>::call(log2, v);
}
};
Expand Down
9 changes: 0 additions & 9 deletions glm/gtc/integer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ namespace glm
template<typename genIUType>
GLM_FUNC_DECL genIUType log2(genIUType x);

template<typename genIUType>
GLM_FUNC_DECL genIUType mod(genIUType x, genIUType y);

template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, T y);

template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y);

/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
/// implementation, presumably the direction that is fastest.
Expand Down
2 changes: 1 addition & 1 deletion test/gtc/gtc_integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace log2_
glm::ivec3 D0(glm::log2(glm::vec3(16.f)));
glm::ivec4 E0(glm::log2(glm::vec4(16.f)));

int A1 = glm::log2(int(16));
int A1 = glm::log2(int(1024));
glm::ivec1 B1 = glm::log2(glm::ivec1(16));
glm::ivec2 C1 = glm::log2(glm::ivec2(16));
glm::ivec3 D1 = glm::log2(glm::ivec3(16));
Expand Down

0 comments on commit 1bf24f8

Please sign in to comment.