bestlong 怕失憶論壇

標題: 無條件進位,不要再忘記了~ [打印本頁]

作者: bestlong    時間: 2010-5-26 20:57     標題: 無條件進位,不要再忘記了~

From http://jasper-dale.spaces.live.c ... E92E2726C!469.entry

每次要用到 無條件進位 都忘記是那個指令!

結果在其中有兩大類喔~天花板 and 地板

function Ceil(const X: Extended):Integer;
Call Ceil to obtain the lowest integer greater than or equal to X.
取得最小整數但是要大於或等於 X
  1.   向上看的天花板
  2.     ↑
  3.  2.0∣2.0
  4.  1.5∣2.0
  5.  1.0∣1.0 
  6.  0.5∣1.0
  7.  0.0。————← 這是地板
  8. -0.5∣0.0
  9. -1.0∣-1.0
複製代碼
function Floor(const X: Extended): Integer;
Call Floor to obtain the highest integer less than or equal to X
取得最大整數但是要小於或等於 X
  1.  2.0∣2.0
  2.  1.5∣1.0
  3.  1.0∣1.0 
  4.  0.5∣0.0
  5.  0.0。————← 這是地板
  6. -0.5∣-1.0
  7. -1.0∣-1.0
  8.     ↓
  9.   向下挖的地板
複製代碼
為什麼每次要用都忘記,是不是老了~




歡迎光臨 bestlong 怕失憶論壇 (http://www.bestlong.idv.tw/) Powered by Discuz! X1.5