Why Math.Ceiling returns double?

后端 未结 5 1746
被撕碎了的回忆
被撕碎了的回忆 2021-01-07 15:52

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

5条回答
  •  抹茶落季
    2021-01-07 16:55

    Because double can contain larger numbers than int or long. Same reason there's no implicit cast from double to int.

提交回复
热议问题