手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>delphi>列表

Delphi中的算术运算函数

来源:互联网 作者:西部数码 时间:2008-04-09
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

Delphi中的算术运算函数

以下内容为编编程网站诸网友共同翻译的结果,如需转载,请注明出处:http://www.togetherdev.com,如果您对翻译Delphi的函数有兴趣,可登录编编程网站,如果对翻译的内容有什么看法,可以在回帖或在编编程网站中提出。

Abs

Ceil

Exp

Floor

frac

Frexp

int

intpower

Ldexp

max

min

pi poly power round sqrt trunc sqr 函数名
ABS 简要介绍: Returns an absolute value. (取绝对值) 所属单元: System 定义: function Abs(X); 详细解释:
Abs returns the absolute value of the argument, X.
X is an integer-type or real-type expression.
(Abs函数用于返回变量X的绝对值,X可以是一个整形的变量或实数型的变量)

返回

函数名
ceil 简要介绍: Rounds variables up toward positive infinity. 所属单元: Math 定义: function Ceil(X: Extended):Integer 详细解释: Call Ceil to obtain the lowest integer greater than or equal to X. The absolute value of X must be less than MaxInt. For example:
Ceil(-2.8) = -2
Ceil(2.8) = 3
Ceil(-1.0) = -1

(调用ceil函数,返回大于或等于x的最小整数值。X的绝对值一定要小于最大整数值。例如:
Ceil(-2.8) = -2

Ceil(2.8) = 3

Ceil(-1.0) = -1)

返回 函数名
Exp 简要介绍: Returns the exponential of X.(Exp函数返回自然对数基底E的X次幂。) 所属单元: System 定义: function Exp(X: Real): Real; 详细解释:

Exp returns the value of e raised to the power of X, where e is the base of the natural logarithms.
(Exp返回e的X次幂的值,其中e是一个自然对数基底。)

范例:
var
   e : real;
   S : string;
begin
   e := Exp(1.0);
   Str(ln(e):3:2, S);
   S := ''''e = ''''   FloatToStr(e)   ''''; ln(e) = ''''   S;
   Canvas.TextOut(10, 10, S);
end;

返回

函数名
Floor 简要介绍: Rounds variables toward negative infinity.(取小于给定值的最大整数) 所属单元: Math 定义: function Floor(X: Extended): Integer; 详细解释:

Call Floor to obtain the highest integer less than or equal to X. For example:

Floor(-2.8) = -3

Floor(2.8) = 2

Floor(-1.0) = -1

Note: The absolute value of X must be less than MaxInt.

(使用Floor函数以取得小于等于X的最大的整数,如:
Floor(-2.8) = -3

Floor(2.8) = 2

Floor(-1.0) = -1

注意:X的绝对值必须小于整形数的最大值)

返回

函数名
Frac 简要介绍: Returns the fractional part of a real number(返回一个实数的小数部分) 所属单元: System 定义: function Frac(X: Extended): Extended; 详细解释:

The Frac function returns the fractional part of the argument X.

X is a real-type expression. The result is the fractional part of X; that is, Frac(X) = X - Int(X).

(Frac函数返回参数X的小数部分,X是一个实型数,该函数的作用等价于Frac(X)=X-Int(X)。)

范例:
var
a,b:Real;
begin
a := 1.54;
b := frac(a);
end;
此时,a= 1.54,b=0.54

返回

函数名
Frexp 简要介绍: Separates the Mantissa and Exponent of X(分解开X的尾数和指数。) 所属单元: Math 定义: procedure Frexp(X: Extended; var Mantissa: Extended; var Exponent: Integer) register; 详细解释:

Frexp returns the mantissa of X as Mantissa and the exponent as Exponent.(Frexp函数返回X的尾数用变量Mantissa和指数用变量Exponent)。

返回

函数名
int 简要介绍: Returns the integer part of a real number.(返回一个实数类型的整数部分) 所属单元: System 定义: function Int(X: Extended): Extended; 详细解释:

Int returns the integer part of X; that is, X rounded toward zero. X is a real-type expression.(Int函数返回参数X的整数部分,X为实数类型,函数结果为X经过负向舍入(向0舍入)实数。)

范例:
var 

  R: Real;
begin
  R := Int(123.456);    { 123.0 }
  R := Int(-123.456);   { -123.0 }
end;

返回

函数名
Intpower 简要介绍: Calculates the integral power of a base value.(计算基数的整数幂。) 所属单元: Math 定义: function IntPower(Base: Extended; Exponent: Integer): Extended register; 详细解释:

IntPower raises Base to the power specified by Exponent

(计算基数的整数幂。base为基数,Exponent为指数)

范例:
 

返回

函数名
Ldexp 简要介绍: Calculates X * (2**P) 所属单元: Math 定义: function Ldexp(X: Extended; P: Integer): Extended register; 详细解释:

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!