为什么Math.Ceiling返回双? [英] Why Math.Ceiling returns double?

查看:197
本文介绍了为什么Math.Ceiling返回双?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#中的方法 Math.Ceiling 返回值。为什么它不返回 INT

In C# the method Math.Ceiling returns a double value. Why does it not return int?

推荐答案

该文件说,对返回值:

的最小整数大于或等于一。如果则为NaN,NegativeInfinity,或PositiveInfinity时,返回的值。

The smallest whole number greater than or equal to a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, that value is returned.

因此​​,返回值是双倍,因为NaN的,NegativeInfinity和PositiveInfinity时是双领域。

Therefore the return value has to be double since NaN, NegativeInfinity and PositiveInfinity are fields of Double.

这篇关于为什么Math.Ceiling返回双?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆