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
2023-02-25 22:28:22
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