CMakeTutorialStep1 2.3.12
Loading...
Searching...
No Matches
TutorialMath.hxx File Reference

教程数学工具声明:平方根与命令行参数校验(经典 .hxx/.cxx,无模块)。 More...

Go to the source code of this file.

Namespaces

namespace  tutorial

Functions

double tutorial::compute_sqrt (double value)
 域检查:非有限、负数或超过 kComputeSqrtMaxInput 时返回 -1.0
bool tutorial::has_numeric_argument (int argc)
 argc >= 2 即认为用户提供了待计算的数值参数

Variables

constexpr double tutorial::kComputeSqrtMaxInput = 1.0e12
 允许的最大输入;超出(或负数 / 非有限)时 compute_sqrt 返回 -1.0

Detailed Description

教程数学工具声明:平方根与命令行参数校验(经典 .hxx/.cxx,无模块)。

纯函数设计便于 gtest 覆盖;实现见 TutorialMath.cxx。