C++ 数学 tanh()2024年8月30日 | 阅读 1 分钟 此函数计算给定弧度角度的双曲正切。 数学上, tanhx = ex -e-x/ ex+e-x 语法假设角度为 'x' 参数x: 要计算其双曲正切的值。 返回值它返回 x 的双曲正切。 示例 1让我们看一个当 x 值为整数类型时的简单示例。 输出 Value of degree is : 60 tanh(x) : 0.780507 在此示例中,tanh(x) 函数计算 x 的双曲正切并返回值为 0.78。 示例 2让我们看一个当 x 值为浮点类型时的简单示例。 输出 Value of degree is : 45.2 tanh(x) : 0.657552 在此示例中,tanh(x) 函数计算 x 的双曲正切并返回值为 0.65。 下一主题C++ 数学函数 |
C++ 数学函数 tan() 该函数计算以弧度表示的角度的正切值。语法 考虑一个弧度 'x'。语法将是:float tan(float x); double tan(double x); long double tan(long double x); double tan(integral x); 注意:如果传递的值是整数类型,则它会被转换为 double。参数 x:...
阅读1分钟
C++ 数学 pow() 此函数用于求给定数字的幂。考虑底数 'b' 和指数 'e'。幂=be 语法 其语法为:double pow(double b, double e); float pow(float b, float e); long double pow(long double b, long double e); promoted pow(type1 b, type2 e); 注意:如果...
阅读1分钟
C++ Math asin() 该函数计算以弧度表示的数字的反弦。asin(x) = sin-1x 语法 假设一个数字是 'x'。语法将是:float asin(float x); double asin(double x); long double asin(long double x); double asin(integral x); 注意:如果传递的值是整数类型,则它将被转换为...
阅读 2 分钟
C++ Math tgamma() tgamma() 函数计算传递给函数的参数的伽马函数。假设一个数字是 x:语法 float tgamma(float x); double tgamma(double x); long double tgamma(long double x); double tgamma(double x); 参数 x:它是一个浮点值。返回值 它返回 x 的伽马函数值。参数 返回值 x...
阅读 2 分钟
C++ Math nearbyint() 该函数使用当前的舍入方法将给定值四舍五入到附近的整数值。当前的舍入方法由 fegetround 描述。语法 假设一个数字是 'x'。语法为:return_type nearbyint(data_type x); 注意:return_type 可以是 float、double 或 long...
阅读1分钟
C++ Math trunc() 该函数将给定值向零取整,并返回一个最近的整数值,其大小不大于给定值。例如:trunc(3.8) = 3;语法 假设一个数为 'x'。语法为:return_type trunc(data_type x); 注意:return_type 可以是 float、double 或 long double。参数 x:...
阅读1分钟
C++ Math llround() 此函数用于对给定值进行四舍五入并转换为 long long 整型。语法 假设一个数字是 'x'。语法将是:long long int llround(data_type x); 参数 x:值可以是 double 或 float。返回值 它返回 x 的四舍五入值。
阅读1分钟
C++ Math fma() 函数计算表达式 x*y+z,而不会在任何中间结果中损失精度。假设数字是 x,y 和 z: fma(x,y,z) = x*y+z; 语法 float fma(float x, float y, float z); double fma(double x, double y, double z); long double fma(long double x, long double y, long double z); double fma(type1...
阅读1分钟
C++ Math erfc() erfc() 函数计算传递给函数的参数的余误差函数值。假设一个数字是 'x':erfc(x) = 1-erf(x); 语法 float erfc(float x) ; double erfc(double x) ; long double erfc(long double x) ; double erfc(integral x); 参数 x:它是一个浮点值。返回值 它返回...
阅读 2 分钟
C++ Math cbrt() 此函数用于查找给定数字的立方根。考虑一个参数 'arg':数字的立方根:∛arg 语法 语法将是: double cbrt(double arg); float cbrt(float arg); long double cbrt(long double arg); double cbrt(integral arg); 参数 arg:它是 float 或 ... 的值
阅读1分钟
我们请求您订阅我们的新闻通讯以获取最新更新。
我们提供所有技术(如 Java 教程、Android、Java 框架)的教程和面试问题
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India