由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - no log2() in visual studio, only log() ?
相关主题
Template Metaprogramming有啥实际用途么?一个WinXP下的qt3小问题
VISUAL STUDIO 2005 输出窗口(output) 怎么找不到?Microsoft Visual Studio Expression edition 是万全free的吗?
visual studio 2005怎么code profiling?如何让visual studio缺省以\n结束,而不是以\r\n结束
问个DLL调用问题请问visual studio里怎么能自动加一个文件到project里?
exe file compild by C++ cannot be run by another computervisual studio版本
A Version problem of Visual StudioVisual Studio Express是免费的么?
How can I find if sp1 is installed for my visual studio 200Visual Studio有木这个功能?
请问 哪里有下microsoft visual studio 2005啊?熟悉visual studio的朋友请帮一下忙
相关话题的讨论汇总
话题: log话题: log2话题: visual话题: studio话题: only
进入Programming版参与讨论
1 (共1页)
s*****w
发帖数: 1527
1
i mean the math function ...
b********e
发帖数: 58
2
You can implement by yourself very easily:
#include
...
// Calculates log2 of number.
double Log2( double n )
{
return log( n ) / log( 2 );
}
s*****w
发帖数: 1527
3
how is it smart enough to know log(8.0)/log(2.0) = 3 ?
log(2.0) is a float, i thought it should come back sth. like 2.98...

【在 b********e 的大作中提到】
: You can implement by yourself very easily:
: #include
: ...
: // Calculates log2 of number.
: double Log2( double n )
: {
: return log( n ) / log( 2 );
: }

b********e
发帖数: 58
4
Actually, for the specific example, I got 3.000000 on my machine. If you are
only concerned with integer numbers and very sticky on the precision of the
result, maybe log function (no matter what the base is) is not your choice.
Good luck.
1 (共1页)
进入Programming版参与讨论
相关主题
熟悉visual studio的朋友请帮一下忙exe file compild by C++ cannot be run by another computer
visual studio 2008学校哪里下载?A Version problem of Visual Studio
Visual Studio 2008How can I find if sp1 is installed for my visual studio 200
关于MFC:问个愚蠢的问题请问 哪里有下microsoft visual studio 2005啊?
Template Metaprogramming有啥实际用途么?一个WinXP下的qt3小问题
VISUAL STUDIO 2005 输出窗口(output) 怎么找不到?Microsoft Visual Studio Expression edition 是万全free的吗?
visual studio 2005怎么code profiling?如何让visual studio缺省以\n结束,而不是以\r\n结束
问个DLL调用问题请问visual studio里怎么能自动加一个文件到project里?
相关话题的讨论汇总
话题: log话题: log2话题: visual话题: studio话题: only