Files
XCEngine/docs/api/math/h/epsilon.md
ssdfasd b414bc5326 refactor(docs): Fix broken links across multiple modules
Fixed broken references:
- texture-import-settings: Fix 16 files referencing wrong overview filename
- math/rectint: Fix 9 method links (rectint-* → get*, contains, intersects)
- rhi/opengl/device: Fix 8 cross-references (opengl-* → */**)
- resources/mesh: Fix meshsection and vertexattribute links
- rhi/d3d12/sampler: Fix RHISampler reference path
- math/vector3: Fix projectonplane → project-on-plane
- rhi/opengl/command-list: Remove broken ClearFlag enum ref
- rhi/opengl/device: Create 2 new method docs (MakeContextCurrent, GetNativeContext)
- rhi/device: Fix device-info types reference

All 0 broken references remaining.
2026-03-26 02:41:00 +08:00

24 lines
646 B
Markdown

# Math::EPSILON
```cpp
constexpr float EPSILON = 1e-6f;
```
`EPSILON` 是一个非常小的浮点数常量,值为 0.000001。该常量主要用于浮点数比较,由于浮点数精度问题,直接使用 `==` 比较浮点数可能产生错误结果,此时应使用 `EPSILON` 进行容差比较。例如判断两个浮点数是否相等,可以检查它们的差的绝对值是否小于 `EPSILON`
**示例:**
```cpp
#include <XCEngine/Core/Math/Math.h>
float a = 0.1f + 0.2f;
float b = 0.3f;
if (fabsf(a - b) < Math::EPSILON) {
// a 和 b 可以视为相等
}
```
## 相关文档
- [Math 总览](h.md) - 返回 Math 概览