NOIP
复赛基础知识汇总
(cxms
)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
为小数时
in ...
附件列表