Z zhukewen Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-01 #2 r: real if r = Trunc(r) then//小数部分为0
S svw0506 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-01 #3 var r:String; begin r:=FloatToStr(你的小数); if StrScan(r,'.')=nil then //小数为位数为零 或 if pos('.',r) <0 then //小数为位数为零 end;
var r:String; begin r:=FloatToStr(你的小数); if StrScan(r,'.')=nil then //小数为位数为零 或 if pos('.',r) <0 then //小数为位数为零 end;
B beta Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-01 #4 if Abs(r - Trunc(r)) < 0.00000001 then 小数位数为 0 这样可以避免误差:)
R Richard3000 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-01 #5 Math Unit裡有一個函數IsZero if IsZero(r - Trunc(r)) then