Why does g++ (4.6 and 4.7) promote the result of this division to a double? Can I stop it?

↘锁芯ラ 提交于 2019-12-05 13:59:24

The problem is

log(r)

In this implementation, it seems that the only log in the global namespace is the C library function, double log(double). Remember that it's not specified whether or not the C-library headers in the C++ library dump their definitions into the global namespace as well as namespace std.

You want

std::log(r)

to ensure that the extra overloads defined by the C++ library are available.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!