浏览代码

math: fix a bug in real::cbrt() that completely broke the function.

legacy
Sam Hocevar 5 年前
父节点
当前提交
5814dd4cf0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      src/math/real.cpp

+ 1
- 1
src/math/real.cpp 查看文件

@@ -821,7 +821,7 @@ template<> real cbrt(real const &x)
real third = inverse(real::R_3());
for (int i = 1; i <= x.bigit_count(); i *= 2)
{
ret = third * (x / (ret * ret) + (ret / 2));
ret = third * (x / (ret * ret) + (ret * 2));
}

return ret;


正在加载...
取消
保存