您现在的位置: 中国教师站 >> 教师关注 >> 电脑技术 >> 编程技术 >> Delphi >> 正文

Google
Delphi中的算术运算函数
作者:Siny 文章来源:中国教师站cn-teacher 点击数: 更新时间:2007-4-22 15:58:06

Delphi中的算术运算函数

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

Abs

Ceil

Exp

Floor

frac

Frexp

int

intpower

Ldexp

max

min

pipolypowerroundsqrttruncsqr函数名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)。)

范例:
vara,b:Real;begina := 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 }en

[1] [2] [3] [4] 下一页

  • 上一篇文章:

  • 下一篇文章:
  • 相关专题:
     
     网友评论:(评论内容只代表网友观点,与本站立场无关!)
    GOOGLE广告

    阅读排行

    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 |
    中国教师站

    中国教师站 版权所有 Copyright © 2006-2020 All Rights Reserved 站长:Sina & Siny
    [备用域名:www.JXZYW.Com] 有事请留言有事请留言
    【实力成就精品 诚信呵护品牌】

    信息产业部备案
    苏ICP备06018635号