MATHEMATICAL FUNCTIONS 数学函数

  1. c++在cmath头文件中提供了许多有用的函数来执行常见的数学函数。

(这个link可以查询所有函数:https://cplusplus.com/reference/cmath/

  1. 常见的函数:

(1)trigonometric functions 三角函数

capture_20241003161931864.bmp

(2)exponent functions 指数函数

capture_20241003161240190.bmp

(3)rounding functions 取整函数

capture_20241003161435054.bmp

*ceil意为天花板,即向上取整;floor意为地板,即向下取整。

(4)the min, max, and absolute functions 取最小、最大和取绝对值函数

capture_20241003161558248.bmp

*输入是一个小数,输出也是一个小数,字符类型不变

CHARACTER DATA TYPE 字符数据类型