C#


ROSLYN.USAGE.CA2242 : Test for NaN correctly (C#)

See Roslyn-Detected C# Warning Classes for more information.

Summary

This expression tests a value against Single.Nan or Double.Nan. Use Single.IsNan(Single) or Double.IsNan(Double) to test the value.

This check corresponds to Roslyn rule CA2242. For full rule details, see the Microsoft website: CA2242.

Properties

Class Name Test for NaN correctly (C#)
Significance reliability
Mnemonic ROSLYN.USAGE.CA2242
Categories None
Availability Available for C# only.
Enabling Checks for this warning class are enabled by default. To disable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Test for NaN correctly (C#)"

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.