A signaling NaN (“not a number”).
SDK
- Xcode 8.0+
Framework
- Swift Standard Library
Declaration
Discussion
The default IEEE 754 behavior of operations involving a signaling NaN is to raise the Invalid flag in the floating-point environment and return a quiet NaN.
Operations on types conforming to the Floating
protocol should support this behavior, but they might also support other options. For example, it would be reasonable to implement alternative operations in which operating on a signaling NaN triggers a runtime error or results in a diagnostic for debugging purposes. Types that implement alternative behaviors for a signaling NaN must document the departure.
Other than these signaling operations, a signaling NaN behaves in the same manner as a quiet NaN.