﻿<?xml version="1.0" encoding="utf-8"?><Type Name="DoNotCompareWithNaNRule" FullName="Gendarme.Rules.Correctness.DoNotCompareWithNaNRule"><TypeSignature Language="C#" Value="public class DoNotCompareWithNaNRule : Gendarme.Rules.Correctness.FloatingComparisonRule, Gendarme.Framework.IMethodRule" /><TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit DoNotCompareWithNaNRule extends Gendarme.Rules.Correctness.FloatingComparisonRule implements class Gendarme.Framework.IMethodRule, class Gendarme.Framework.IRule" /><AssemblyInfo><AssemblyName>Gendarme.Rules.Correctness</AssemblyName><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>Gendarme.Rules.Correctness.FloatingComparisonRule</BaseTypeName></Base><Interfaces><Interface><InterfaceName>Gendarme.Framework.IMethodRule</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Usage", "CA2242:TestForNaNCorrectly")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Problem("This method compares a floating point value with NaN (Not a Number) which always return false, even for (NaN == NaN).")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Solution("Replace the code with a call to the appropriate Single.IsNaN(value) or Double.IsNaN(value).")</AttributeName></Attribute></Attributes><Docs><summary>
            As defined in IEEE 754 it's impossible to compare any floating-point value, even
            another <c>NaN</c>, with <c>NaN</c>. Such comparison will always return <c>false</c>
            (more information on [http://en.wikipedia.org/wiki/NaN wikipedia]). The framework
            provides methods, <c>Single.IsNaN</c> and <c>Double.IsNaN</c>, to check for
            <c>NaN</c> values.
            </summary><remarks>To be added.</remarks><example>
            Bad example:
            <code>
            double d = ComplexCalculation ();
            if (d == Double.NaN) {
            	// this will never be reached, even if d is NaN
            	Console.WriteLine ("No solution exists!");
            }
            </code></example><example>
            Good example:
            <code>
            double d = ComplexCalculation ();
            if (Double.IsNaN (d)) {
            	Console.WriteLine ("No solution exists!");
            }
            </code></example></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public DoNotCompareWithNaNRule ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><Parameters /><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="CheckMethod"><MemberSignature Language="C#" Value="public Gendarme.Framework.RuleResult CheckMethod (Mono.Cecil.MethodDefinition method);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype Gendarme.Framework.RuleResult CheckMethod(class Mono.Cecil.MethodDefinition method) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gendarme.Framework.RuleResult</ReturnType></ReturnValue><Parameters><Parameter Name="method" Type="Mono.Cecil.MethodDefinition" /></Parameters><Docs><param name="method">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member></Members></Type>