- 热门文章:
- · 虚拟键码表(windows)
- · ORACLE简单应用
- · get CPU id (很全的)
- · Singleton模式之Delphi实现
- · 在RxRichEdit中插入图片的完美解决方法(不使用剪贴板)
- · SHELL编程:利用CSIDL打开特殊文件夹
- · 检查特殊字符的简单VCL
- · Data-Browse型Data-Aware控件的制作
- · 关于Delphi7的IntraWeb 编译的Apache (DSO) 模块
- · 《Delphi高手突破》节选--脱离VCL的Windows程序
- · 完成DELPHI的不可能功能:宏替换!(如何根据字符串来创建对象)
- · 应用程序框架的使用技巧
Delphi中的算术运算函数
以下内容为编编程网站诸网友共同翻译的结果,如需转载,请注明出处:http://www.togetherdev.com,如果您对翻译Delphi的函数有兴趣,可登录,如果对翻译的内容有什么看法,可以在回帖或在编编程网站中提出。
| 函数名 | |
| 简要介绍: | 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可以是一个整形的变量或实数型的变量) |
| 函数名 | |
| 简要介绍: | 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的绝对值一定要小于最大整数值。例如: |
| 函数名 | |
| 简要介绍: | 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. |
| 范例: | 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; |
| 函数名 | |
| 简要介绍: | 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函数以取得小于等于X的最大的整数,如: |
| 函数名 | |
| 简要介绍: | 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. (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 |
| 函数名 | |
| 简要介绍: | 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)。 |
| 函数名 | |
| 简要介绍: | 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; |
| 函数名 | |
| 简要介绍: | 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为指数) |
| 范例: | |
| 函数名 | |
| 简要介绍: | Calculates X * (2**P) |
| 所属单元: | Math |
| 定义: | function Ldexp(X: Extended; P: Integer): Extended register; |
| 详细解释: |
Ldexp returns X times (2 to the power of P). |
| 函数名 | |
| 简要介绍: | 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. |
| 函数名 | |
| 简要介绍: | 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. |
| 函数名 | |
| 简要介绍: | Returns 3.1415926535897932385. (返回3.1415926535897932385.) |
| 所属单元: | System |
| 定义: | function Pi: Extended; |
| 详细解释: |
Use Pi in mathematical calculations that require pi, the ratio of a circle´s circumference to its diameter. Pi is approximated as 3.1415926535897932385. |
| 函数名 | (本条翻译无把握) |
| 简要介绍: | 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: |
| 函数名 | |
| 简要介绍: | 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. |
| 函数名 | |
| 简要介绍: | 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. (Round返回X向最近整数值的舍入。 |
| 范例: | 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; |
| 函数名 | |
| 简要介绍: | Returns the square of a number.(取给定值的平方) |
| 所属单元: | System |
| 定义: | function Sqr(X: Extended): Extended; |
| 详细解释: |
The Sqr function returns the square of the argument. |
| 范例: | 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; |
| 函数名 | |
| 简要介绍: | 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. |
| 范例: | 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; |
| 函数名 | |
| 简要介绍: | Truncates a real number to an integer.(截取一个实数的整数部分) |
| 所属单元: | System |
| 定义: | function Trunc(X: Extended): Int64; |
| 详细解释: |
The Trunc function truncates a real-type value to an integer-type value. X is a real-type expression. Trunc returns an Int64 value that is the value of X rounded toward zero. |
| 范例: | var S, T: string; begin Str(1.4:2:1, T); S := T + ´ Truncs to ´ + IntToStr(Trunc(1.4)) + #13#10; Str(1.5:2:1, T); S := S + T + ´ Truncs to ´ + IntToStr(Trunc(1.5)) + #13#10; Str(-1.4:2:1, T); S := S + T + ´ Truncs to ´ + IntToStr(Trunc(-1.4)) + #13#10; Str(-1.5:2:1, T); S := S + T + ´ Truncs to ´ + IntToStr(Trunc(-1.5)); MessageDlg(S, mtInformation, [mbOk], 0); end; |
- · Delphi5.5的MIDAS编程(客户端)
- · Return to Sender
- · ktv 系统设计经验
- · 游戏开发者社区对底层API的投票
- · winsock 函数简介
- · 利用书签功能对TDBGrid控件中多个记录的处理
- · 如何将几个DBGRID里的内容导入同一个EXCEL表中?
- · 在DELPHI程序中自动设置ODBC数据源
- · 使用TNMSMTP控件在需认证服务器上发送邮件
- · 如何为Delphi程序添加事件和事件处理器
- · Delphi多线程下的ADO编程
- · 分布式数据库应用开发正解 [系列之一]
- · SGIP的delphi原码
- · SGIP的delphi原码
- · 转载:TThread类剖析
- · Delphi代码风格约定
- · Delphi 完全时尚手册之 CoolBar 篇---实现 CoolBar 的新特性 Chevron
- · 两种Delphi实现Singleton模式方法
- · Indy Client / Server 程序示例
- · Delphi中关于TApplication类的详解
- · 如何利用ADO操纵Excel文件
- · 三层开发基本概念介绍
- · Borland重操旧业 推出新品再次叫板微软
- · Windows消息机制初谈
- · Delphi中的类和对象
- · 基于中间件的查询优化模型
- · 具有自动查找Web页面上所有链接的网络浏览器
- · 局域网中文件夹的共享 Windows NT/2000/XP
- · 给大学生的十五条建议
- · ms agent 经典用法
- · 向word文档中输出表格及图形
- · 限制并方便用户输入
- · udp 500 D.O.S攻击
- · Delphi的BUGS之我见
- · InstallShield Express for delphi制作安装程序定制BDE引擎
- · 如何在Delphi中用代码来完成计算字段的创建
- · IBM收购Rational后续 市场分析微软将收购Borland
- · 如何实现SocketConnetion的连接配置
