20 lines
498 B
Markdown
20 lines
498 B
Markdown
|
|
# Math::FLOAT_MAX
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
constexpr float FLOAT_MAX = 3.402823466e+38f;
|
||
|
|
```
|
||
|
|
|
||
|
|
`FLOAT_MAX` 是 IEEE 754 单精度浮点数能表示的最大正有限值,约为 3.402823466e+38。该常量常用于初始化变量为最大值、在搜索算法中作为上界、或在需要表示"无穷大"但又不想引入 `INFINITY` 的场景中使用。
|
||
|
|
|
||
|
|
**示例:**
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
#include <XCEngine/Math/Math.h>
|
||
|
|
|
||
|
|
float maxDistance = Math::FLOAT_MAX;
|
||
|
|
```
|
||
|
|
|
||
|
|
## 相关文档
|
||
|
|
|
||
|
|
- [Math 总览](h.md) - 返回 Math 概览
|