internal API
internal 包存放其他包用来选择步长和界定舍入误差的机器常量,不包含任何函数。这些常量与 GNU Scientific Library 中 gsl_machine.h 的常量一致。
机器常量
每个常量都是名为 machine_<prefix><quantity> 的 Double。其中 quantity 表示某种浮点格式的一个极限值:
| 量 | 含义 |
|---|---|
dbl_epsilon | 双精度的机器精度,。 |
dbl_min | 最小的正规格化双精度数,。 |
dbl_max | 最大的有限双精度数,。 |
flt_epsilon | 单精度的机器精度,。 |
flt_min | 最小的正规格化单精度数。 |
flt_max | 最大的有限单精度数。 |
sflt_epsilon | GSL 短浮点格式的机器精度,。 |
eps | GSL_MACH_EPS 系列中取整后的机器容差,仅以带前缀的形式存在。 |
前缀表示对该量所取的函数:
| 前缀 | 值 | 适用于 |
|---|---|---|
| 无 | 该量本身 | dbl_*, flt_*, sflt_epsilon |
sqrt_ | 其平方根 | 所有量 |
root_3_ 至 root_6_ | 其三次至六次方根 | 所有量 |
log_ | 其自然对数 | 所有量 |
例如,machine_sqrt_dbl_epsilon 为 ,machine_log_dbl_max 为 。取整后的 eps 值为 machine_sqrt_eps()、machine_root_3_eps()、machine_root_4_eps()、machine_root_5_eps()、machine_root_6_eps()和 machine_log_eps()。