Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 如何对整数除法的结果进行四舍五入
double d1=11, double d2=2 int i=d1/d2;
我会是 5。但我希望它返回 6。(如果结果是 5.01,我也想要 6)我应该怎么做?
int i = (int)Math.Ceiling(d1/d2);