|
|
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);详细解释:返回
函数名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函数,返回大于或等于x的最小整数值。X的绝对值一定要小于最大整数值。例如:
Ceil(-2.8) = -2
Ceil(2.8) = 3
Ceil(-1.0) = -1)
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
网友评论:(评论内容只代表网友观点,与本站立场无关!) |
阅读排行
|