LOG2在我的math.h中没有发现? [英] log2 not found in my math.h?

查看:1945
本文介绍了LOG2在我的math.h中没有发现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是一个相当新的安装Visual C ++的2008例preSS。

I'm using a fairly new install of Visual C++ 2008 Express.

我试图编译使用LOG2功能,这是由在Mac上使用Eclipse,包括发现了一个程序,但此Windows计算机无法找到此功能(错误C3861:'LOG2':标识符找不到)

I'm trying to compile a program that uses the log2 function, which was found by including using Eclipse on a Mac, but this Windows computer can't find the function (error C3861: 'log2': identifier not found).

我的理解是这样的,包括目录是特定于IDE,对不对? math.h中是不是在我的SDK微软\\ WINDOWS \\ v6.0A \\包含\\目录present,但我没有找到此目录中math.h中:微软的Visual Studio 9.0 \\ VC \\ include中。还有一个CMATH在该目录...

The way I understood it, include directories are specific to the IDE, right? math.h is not present in my Microsoft SDKs\Windows\v6.0A\Include\ directory, but I did find a math.h in this directory: Microsoft Visual Studio 9.0\VC\include. There is also a cmath in that directory...

在哪里LOG2?

推荐答案

函数原型:double LOG2(双aNumber的);

   头文件:math.h中(C)或CMATH(C ++)

Prototype: double log2(double anumber);
Header File: math.h (C) or cmath (C++)

或者效仿它像这里

#include <math.h>  
...  
// Calculates log2 of number.  
double Log2( double n )  
{  
    // log(n)/log(2) is log2.  
    return log( n ) / log( 2 );  
}

不幸的是微软不提供它

这篇关于LOG2在我的math.h中没有发现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆