Skip to content

Commit 25528eb

Browse files
author
abacus_fixer
committed
revert(vector3): 撤销operator==的eps精度比较修改
- 恢复Vector3的operator==为直接比较 - 移除之前添加的eps精度比较逻辑 修改文件: - source/source_base/vector3.h
1 parent 39811c4 commit 25528eb

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

source/source_base/vector3.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ template <class T> inline bool operator!=(const Vector3<T> &u, const Vector3<T>
389389
// whether u == v
390390
template <class T> inline bool operator==(const Vector3<T> &u, const Vector3<T> &v)
391391
{
392-
const T eps = 1e-15;
393-
if (std::abs(u.x - v.x) < eps && std::abs(u.y - v.y) < eps && std::abs(u.z - v.z) < eps)
392+
if (u.x == v.x && u.y == v.y && u.z == v.z)
394393
return true;
395394
return false;
396395
}

0 commit comments

Comments
 (0)