表达式pow(2.8,sqrt((double)x))的值的数据类型为???

horson 2006-10-24 09:48:58
另外POW是干嘛的??
...全文
571 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jokar 2006-10-24
  • 打赏
  • 举报
回复
偶也刚看过 msdn:)
飞哥 2006-10-24
  • 打赏
  • 举报
回复
pow
Calculates x raised to the power of y.

double pow( double x, double y );

Routine Required Header Compatibility
pow <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

pow returns the value of xy. No error message is printed on overflow or underflow.

Values of x and y Return Value of pow
x < > 0 and y = 0.0 1
x = 0.0 and y = 0.0 1
x = 0.0 and y < 0 INF


Parameters

x

Base

y

Exponent

Remarks

The pow function computes x raised to the power of y.

pow does not recognize integral floating-point values greater than 264, such as 1.0E100.

Example

/* POW.C
*
*/

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

void main( void )
{
double x = 2.0, y = 3.0, z;

z = pow( x, y );
printf( "%.1f to the power of %.1f is %.1f\n", x, y, z );
}


Output

2.0 to the power of 3.0 is 8.0


Floating-Point Support Routines

晨星 2006-10-24
  • 打赏
  • 举报
回复
类型就是pow函数的返回什类型。
pow是一个库函数,声明在<math.h>中,求次方的。返回值是double型。
使用boost::sprirt编写的表达式解析器,代码很容易扩展,功能很强大,适合做功能强大的客户化定义程序。 -----------表达式解析--------- 已定义的函数有:PI,SIN,COS,TAN,,ABS,EXP,LOGN,POW,SQRT,FORMAT,LENGTH,SUBSTR 强制类型转换请使用:(数据类型)数据 例如:(int) "100" 的为int型100 已定义的变量有:var1=123,var2=this is a string 请输入您的表达式>>1+2 计算结果:3 XML格式显示计算过程: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- 1+2 --> + 1 2 计算结果数据类型:integer 计算结果:3 请输入您的表达式>>"ab"+"cd" 计算结果:"abcd" XML格式显示计算过程: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- "ab"+"cd" --> + "ab" "cd" 计算结果数据类型:string 计算结果:abcd 请输入您的表达式>>format("1+2=%d",1+2) 计算结果:format("1+2=%d",3) XML格式显示计算过程: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- format("1+2=%d",1+2) --> format "1+2=%d" + 1 2 计算结果数据类型:string 计算结果:1+2=3 请输入您的表达式>>PI() 计算结果:PI() XML格式显示计算过程: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- PI() --> PI 计算结果数据类型:double 计算结果:3.1415926535897931 请输入您的表达式>>cos(1.5) 计算结果:cos(1.5) XML格式显示计算过程: <?xml version="1.0" encoding="ISO-8859-1"?> <!-- cos(1.5) --> cos 1.5 计算结果数据类型:double 计算结果:0.070737201667702906 请输入您的表达式>>q

69,336

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧