Delphi中的算术运算函数.doc_第1页
Delphi中的算术运算函数.doc_第2页
Delphi中的算术运算函数.doc_第3页
Delphi中的算术运算函数.doc_第4页
Delphi中的算术运算函数.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

AbsCeilExpFloorfracFrexpintintpowerLdexpmaxminpipolypowerroundsqrttruncsqr函数名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) = -2Ceil(2.8) = 3Ceil(-1.0) = -1 (调用ceil函数,返回大于或等于x的最小整数值。X的绝对值一定要小于最大整数值。例如:Ceil(-2.8) = -2Ceil(2.8) = 3Ceil(-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) = -3Floor(2.8) = 2Floor(-1.0) = -1Note: The absolute value of X must be less than MaxInt. (使用Floor函数以取得小于等于X的最大的整数,如:Floor(-2.8) = -3Floor(2.8) = 2Floor(-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 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;详细解释:Ldexp returns X times (2 to the power of P).(Ldexp计算X*(2*P),返回X的(2的P次幂)次幂。)返回函数名Max简要介绍:Returns the greater of two numeric values.(取两个数中的最大值)所属单元:Math定义:function Max(A,B: Integer): Integer; overload;function Max(A,B: Int64): Int64; overload;function Max(A,B: Single): Single; overload;function Max(A,B: Double): Double; overload;function Max(A,B: Extended): Extended; overload;详细解释:Call Max to compare two numeric values. Max returns the greater value of the two.(返回两个数值中的最大值。调用Max比较两个数值。它返回二者中较大的一个值。)返回函数名Min简要介绍:Returns the lesser of two numeric values.(取两个数的最小值)所属单元:Math定义:function Min(A,B: Integer): Integer; overload;function Min(A,B: Int64): Int64; overload;function Min(A,B: Single): Single; overload;function Min(A,B: Double): Double; overload;function Min(A,B: Extended): Extended; overload;详细解释:Call Min to compare two numeric values. Min returns the smaller value of the two.(返回两个数值中的最小值。调用Max比较两个数值,它返回二者中较小的一个值。)返回函数名pi简要介绍:Returns 3.1415926535897932385. (返回3.1415926535897932385.)所属单元:System定义:function Pi: Extended;详细解释:Use Pi in mathematical calculations that require pi, the ratio of a circles circumference to its diameter. Pi is approximated as 3.1415926535897932385.(使用Pi函数精确计算返回圆周率Pi,圆周率是一个圆的周长除以它的直径。Pi的值近似于3.1415926535897932385.)返回函数名poly(本条翻译无把握)简要介绍:Evaluates a uniform polynomial of one variable at the value X.所属单元:Math定义:function Poly(X: Extended; const Coefficients: array of Double): Extended;详细解释:Call Poly to evaluate the polynomial represented by the Coefficients parameter at the point where the variable equals the value of the X parameter. The coefficients are ordered in increasing powers of X:Coefficients0 + Coefficients1*X + . + CoefficientsN*(X*N)(Poly估计一个变量在同一多项式的X值。调用Poly评估由Coefficients参数表达的多项式在一位置的值等同于X参数的值。参数是顺序的以X的幂增加:Coefficients0+coefficients1*X+.+Cofficientsn*X*N)返回函数名power简要介绍:Raises Base to any power.(取一个实数的幂)所属单元:Math定义:function Power(Base, Exponent: Extended): Extended;详细解释:Power raises Base to any power. For fractional exponents or exponents greater than MaxInt, Base must be greater than 0.(返回一个实数的幂。 当指数Exponent为小数或大于MaxInt时,底数Base必须大于0.)返回函数名Round简要介绍:Returns the value of X rounded to the nearest whole number.(对一个实数进行四舍五入)所属单元:System定义:function Round(X: Extended): Int64;详细解释:The Round function rounds a real-type value to an integer-type value.X is a real-type expression. Round returns an Int64 value that is the value of X rounded to the nearest whole number. If X is exactly halfway between two whole numbers, the result is always the even number.If the rounded value of X is not within the Int64 range, a run-time error is generated, which can be handled using the EInvalidOp exception.(Round返回X向最近整数值的舍入。函数将一个实型值舍入为一个整型值。X是一个实型表达式。Round返回一个长整型值,是离X最近的整数值。如果X是两个整数值的正中间,结果是绝对值最大的一个。如果X的舍入值不是在长整型范围内,一个运行时间错误将产生,可以使用EinvalidOp异常来处理)范例:var S, T: string;begin Str(1.4:2:1, T); S := T + rounds to + IntToStr(Round(1.4) + #13#10; Str(1.5:2:1, T); S := S + T + rounds to + IntToStr(Round(1.5) + #13#10; Str(-1.4:2:1, T); S := S + T + rounds to + IntToStr(Round(-1.4) + #13#10; Str(-1.5:2:1, T); S := S + T + rounds to + IntToStr(Round(-1.5); MessageDlg(S, mtInformation, mbOk, 0);end;返回函数名Sqr简要介绍:Returns the square of a number.(取给定值的平方)所属单元:System定义:function Sqr(X: Extended): Extended;详细解释:The Sqr function returns the square of the argument.X is a floating-point expression. The result, of the same type as X, is the square of X, or X*X.(Sqr返回X得平方值,X是一个浮点型的数,返回值的类型与X 相同,值为X*X)范例:var S, Temp: string;begin Str(Sqr(5.0):3:1, Temp); S := 5 squared is + Temp + #13#10; Str(Sqrt(2.0):5:4, Temp); S := S + The square root of 2 is + Temp; MessageDlg(S, mtInformation, mbOk, 0);end;返回函数名sqrt简要介绍:Returns the square root of X.所属单元:System定义:function Sqrt(X: Extended): Extended;详细解释:X is a floating-point expression. The result is the square root of X.(取X的平方根,X是一个浮点数,返回值也是个浮点数)范例:var S, Temp: string;begin Str(Sqr(5.0):3:1, Temp); S := 5 squared is + Temp + #13#10; Str(Sqrt(2.0):5:4, Temp); S := S + The square root of 2 is + Temp; MessageDlg(S, mt

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论