| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3962 人关注过本帖
标题:急问c++中取对数的函数是什么,怎么使用?谢谢
只看楼主 加入收藏
haqi
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2005-11-23
收藏
 问题点数:0 回复次数:3 
急问c++中取对数的函数是什么,怎么使用?谢谢
知道一定要告诉我啊
搜索更多相关主题的帖子: 对数 函数 
2005-12-05 18:07
lisypro
Rank: 4
等 级:业余侠客
威 望:3
帖 子:695
专家分:216
注 册:2005-9-25
收藏
得分:0 
什么叫对数

长期承接管理系统
代做各种vb/ / vc小程序
QQ:82341763
手机:13623290828
群号 11619730
2005-12-06 08:18
bivl
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2005-12-4
收藏
得分:0 

是不是求绝对值,
包含cmath头文件
涵数是fabs()
比如fabs(-15)
等于15。
不知道是不是你想要的。

2005-12-06 22:58
RL720
Rank: 1
等 级:新手上路
帖 子:148
专家分:0
注 册:2005-11-6
收藏
得分:0 
就是log
MSDN解释如下....


log, log10
Calculates logarithms.

double log( double x );

double log10( double x );

Routine Required Header Compatibility
log <math.h> ANSI, Win 95, Win NT
log10 <math.h> ANSI, Win 95, Win NT


For additional compatibility information, see Compatibility in the Introduction.

Libraries

LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version


Return Value

The log functions return the logarithm of x if successful. If x is negative, these functions return an indefinite (same as a quiet NaN). If x is 0, they return INF (infinite). You can modify error handling by using the _matherr routine.

Parameter

x

Value whose logarithm is to be found

Example

/* LOG.C: This program uses log and log10
* to calculate the natural logarithm and
* the base-10 logarithm of 9,000.
*/

#include <math.h>
#include <stdio.h>

void main( void )
{
double x = 9000.0;
double y;

y = log( x );
printf( "log( %.2f ) = %f\n", x, y );
y = log10( x );
printf( "log10( %.2f ) = %f\n", x, y );
}


Output

log( 9000.00 ) = 9.104980
log10( 9000.00 ) = 3.954243


Floating-Point Support Routines

See Also exp, _matherr, pow

[此贴子已经被作者于2005-12-6 23:19:13编辑过]


2005-12-06 23:17
快速回复:急问c++中取对数的函数是什么,怎么使用?谢谢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014071 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved