soso9spikear soso9spikear
(+_+)
关注数: 0 粉丝数: 6 发帖数: 1,012 关注贴吧数: 2
Math库实用汇总 Math库实用汇总 在FP中,Math库为我们提供了丰富的数学函数。以下介绍在OI中可能会用到的Math库中一些函数、过程。 使用方法:在程序头用Uses语句加载Math库 例子: Program Ex_Math; Uses Math; Begin Writeln(hypot(3,4)); End. 函数介绍:  hypot 原型:function hypot(x:float;y:float):float 功能:返回直角三角形中较长边的长度,也就是sqrt(sqr(x)+sqr(y))  ceil 原型:function ceil(x:float):Integer 功能:返回比参数大的最小整数 引发错误:在x超出Integer的范围时会引发溢出错误  floor 原型:function floor(x:float):Integer 功能:返回参数小的最大整数 引发错误:在x超出Integer的范围时会引发溢出错误  power 原型:function power(base:float;exponent:float):float 功能:返回base的exponent次方 引发错误:在base为负数且exponent为小数时  intpower 原型:function intpower(base:float;const exponent:Integer):float 功能:返回base的exponent次方  ldexp 原型:function ldexp(x:float;const p:Integer):float 功能:返回2的p次方乘以x  log10 原型:function log10(x:float):float 功能:返回x的常用对数  log2 原型:function log2(x:float):float 功能:返回x以2为底的对数  logn 原型:function logn(n:float;x:float):float 功能:返回x以n为底的对数  Max 原型:function Max(a:Integer;b:Integer):Integer function Max(a:Int64;b:Int64):Int64 function Max(a:Extended;b:Extended):Extended 功能:返回a与b中较大的一个  Min 原型:function Min(a:Integer;b:Integer):Integer function Min(a:Int64;b:Int64):Int64 function Min(a:Extended;b:Extended):Extended 功能:返回a与b中较小的一个  arcsin 原型:function arcsin(x:float):float 功能:返回x的反正弦值,返回的是弧度指单位  arccos 原型:function arccos(x:float):float 功能:返回x的反余弦值,返回的是弧度指单位  tan 原型:function tan(x:float):float 功能:返回x的正切值,x以弧度为单位  cotan 原型:function cotan(x:float):float 功能:返回x的余切值,x以弧度为单位  arcsinh 原型:function arcsinh(x:float):float 功能:返回双曲线的反正弦  arccosh 原型:function arccosh(x:float):float 功能:返回双曲线的反余弦  arctanh 原型:function arctanh(x:float):float 功能:返回双曲线的反正切  sinh 原型:function sinh(x:float):float 功能:返回双曲线的正弦  cosh 原型:function sinh(x:float):float 功能:返回双曲线的正弦  tanh 原型:function sinh(x:float):float 功能:返回双曲线的正切  cycletorad 原型:function cycletorad(cycle:float):float 功能:返回圆的份数转换成弧度之后的值  degtorad 原型:function degtorad(deg:float):float 功能:返回角度转换成弧度之后的值  radtocycle 原型:function radtocycle(rad:float):float 功能:返回弧度转换成圆的份数之后的值  radtodeg 原型:function radtodeg(rad:float):float 功能:返回弧度转换成角度之后的值  MaxValue 原型:function maxvalue(const data:Array[] of float):float function maxvalue(const data:Array[] of Integer):Integer function maxvalue(const data:PFloat;const N:Integer):float
1 下一页