MS Visual c++中缺少的一个双曲圆弧正切函数
atanh arc-hyperbolic tangent function missing in MS Visual C++
我正在处理一些以前在Linux上用gcc编译器编译的代码,当用MS Visual c++ 2008编译时,math.h似乎不包括所有相同的功能,特别是(逆)弧-双曲正切atanh函数。
我试过包括math.h, cmath,使用std::atanh,并没有发现很多其他与谷歌/MSDN搜索。是否有一个简单的头文件,我可以包括,有这个?
错误C3861: 'atanh':标识符未找到
以下是不同版本的数学库中包含的内容和不包含的内容。
Function POSIX old ISO ISO C99 Microsoft(2008)
acos Y Y Y Y
acosh Y N Y N
asin Y Y Y Y
asinh Y N Y N
atan Y Y Y Y
atan2 Y Y Y Y
atanh Y N Y N
你不能使用下列公式来实现你自己的函数:
asinh(x) = log(x + sqrt(x2 + 1))
acosh(x) = log(x + sqrt(x2 - 1))
atanh(x) = (log(1+x) - log(1-x))/2
。
float atanh (float x)
{
//implements: return (log(1+x) - log(1-x))/2
}
据此,在c++ 11中引入了atanh。由于c++ 11是在2011年推出的,所以你可能无法在VS 2008中使用它。
相关文章:
- 创建一个函数以在输入为负数或零时输出字符串.第一次执行用户定义的函数
- 如何仅为一个函数添加延迟
- 有没有什么方法可以使用一个函数中定义的常量变量,也可以由c++中同一程序中的其他函数使用
- 我需要将多个函数组合为一个函数
- 在C++中声明一个函数时,它需要有函数本身的参数吗
- 如何创建一个函数来计算并返回平均值、最大值和最小值
- 一个函数,用于查找字符串1包含字符串2 c++的次数
- 如何将一个类的函数作为另一个类的另一个函数的参数传递
- 编写一个函数以使用 n 百分比的 CPU 使用率
- 将 N-arg 函数包装到另一个函数中
- 如何封装一个函数,以便它只能由同一类中的一个其他函数调用?
- C++(.cpp文件和.h文件)拆分代码并添加一个函数,提取 - 这很容易吗?
- C++从另一个函数退出函数
- 编写一个函数来删除单链表中的节点(尾部除外),仅授予对该节点的访问权限
- 视觉我希望一个函数在另一个函数C++中进行计算
- C ++如何在原始抽象类中创建一个函数,该函数接受派生类的输入
- 在另一个函数 (c++) 中调用变量
- 如何在另一个函数中使用返回值作为参数?
- 如何包装一个函数以适应另一个函数的所需类型
- 创建一个函数的 Python 绑定,返回指向带有 boost 的向量的指针