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 val1 = 0.0; double? val2 = val1;
为什么 val2 会导致 NaN?
简单地说:它不会也不会。
将非 NaN 分配给 a 的结果double是double?具有double?非 NaN 值的 a;在这种情况下0.0
double
double?
0.0