浏览代码

Added missing assert for sqrt

Christophe Riccio 12 年之前
父节点
当前提交
d3b8b25dd4
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      glm/core/func_exponential.inl

+ 2 - 0
glm/core/func_exponential.inl

@@ -146,6 +146,8 @@ namespace detail
 			std::numeric_limits<genType>::is_iec559,
 			std::numeric_limits<genType>::is_iec559,
 			"'sqrt' only accept floating-point inputs");
 			"'sqrt' only accept floating-point inputs");
 
 
+		assert(x >= genType(0));
+
 		return std::sqrt(x);
 		return std::sqrt(x);
 	}
 	}