如何将实型转换为整型(20分)

  • 主题发起人 Lee Linlin
  • 开始时间
L

Lee Linlin

Unregistered / Unconfirmed
GUEST, unregistred user!
有没有函数将实行数据转换为整型数据(去掉小数位)
 
function Trunc(X: Extended): Longint;
 
function Round(X: Real): Longint;
Round Rounds a real-type value to an Integer-type value.
Round可以四舍五入
Trunc Truncates a real-type value to an Integer-type value.
 
trunc to get the int part of the real
round to get 4 cut 5 add to change the real to integer
 
function Trunc(X : Extended) : LongInt
function Round(X : Real) : LongInt
 
Trunc
Round
 
上帝呀!这个问题再不结束,影响论坛的形象了 :)
不能给自己加分也就算了 ^_^
 
顶部