时间:2020-12-13 10:22:13 | 栏目:.NET代码 | 点击:次
C#中double和float类型有两个特殊值:
Infinity(无穷大):5.0 / 0.0 = Infinity
NaN(not a number):0.0 / 0.0 = NaN
计算表达式 0.0 / 0.0 = NaN,
NaN和Infinity可以在表达式中使用:
10 + Infinity = Infinity
10 + NaN = NaN
Infinity * 0 = 0
NaN * 0 = NaN