15.6 怎樣取整數?

最簡單、直接的方法:
	(int)(x + 0.5)
這個方法對於負數並不正常工作。可以使用一個類似的方法:
	(int)(x < 0 ? x - 0.5 : x + 0.5)

翻譯朱群英、孫雲, LaTeX2HTML 編譯 朱群英 (2005-06-23)