254 references to NaN
ConfigurationSchemaGenerator (1)
RuntimeSource\SourceGenerators\CSharpSyntaxUtilities.cs (1)
43case float.NaN:
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
83{ float.NaN, nameof(float.NaN) },
Microsoft.AspNetCore.App.Analyzers (1)
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (1)
270float f when f is float.NaN => "float.NaN",
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
83{ float.NaN, nameof(float.NaN) },
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
83{ float.NaN, nameof(float.NaN) },
Microsoft.CodeAnalysis.CSharp (2)
Binder\PatternExplainer.cs (1)
879float.NaN => "float.NaN",
Utilities\ValueSetFactory.SingleTC.cs (1)
22float FloatingTC<float>.NaN => float.NaN;
Microsoft.CodeAnalysis.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
83{ float.NaN, nameof(float.NaN) },
Microsoft.Data.Analysis (1)
PrimitiveDataFrameColumn.cs (1)
886(ref float value) => value = column[cursor.Position] ?? float.NaN;
Microsoft.Data.Analysis.Tests (1)
DataFrameIDataViewTests.cs (1)
164Assert.Equal(float.NaN, preview.ColumnView[3].Values[5]); // null row
Microsoft.Maui (6)
Layouts\Flex.cs (6)
266 public float Bottom { get; set; } = float.NaN; 281 public float Height { get; set; } = float.NaN; 293 public float Left { get; set; } = float.NaN; 354 public float Right { get; set; } = float.NaN; 364 public float Top { get; set; } = float.NaN; 369 public float Width { get; set; } = float.NaN;
Microsoft.Maui.Controls (6)
Layout\FlexLayout.cs (2)
449 item.Width = width < 0 ? float.NaN : (float)width; 451 item.Height = height < 0 ? float.NaN : (float)height;
LegacyLayouts\FlexLayout.cs (4)
337 item.Width = width < 0 ? float.NaN : (float)width; 339 item.Height = height < 0 ? float.NaN : (float)height; 368 item.Width = ((View)sender).WidthRequest < 0 ? float.NaN : (float)((View)sender).WidthRequest; 369 item.Height = ((View)sender).HeightRequest < 0 ? float.NaN : (float)((View)sender).HeightRequest;
Microsoft.ML.AutoML.Tests (2)
DatasetDimensionsTests.cs (2)
47dataBuilder.AddColumn("Nan", NumberDataViewType.Single, new float[] { 0, 1, 0, 1, float.NaN }); 76new float[] { 1, float.NaN },
Microsoft.ML.Core (6)
Utilities\DoubleParser.cs (4)
118value = Single.NaN; 137value = Single.NaN; 500value = Single.NaN; 507value = Single.NaN;
Utilities\MathUtils.cs (2)
709return float.NaN; 721return float.NaN;
Microsoft.ML.Core.Tests (4)
UnitTests\DataTypes.cs (2)
34float fVal = float.NaN; 44Assert.Equal(float.NaN, fVal);
UnitTests\TestUtilities.cs (2)
74x[0] = float.NaN; 108x[0] = float.NaN;
Microsoft.ML.CpuMath (2)
AlignedArray.cs (2)
72Items[i] = float.NaN; 74Items[i] = float.NaN;
Microsoft.ML.Data (21)
Data\Conversion.cs (3)
802private void GetNA(ref R4 value) => value = R4.NaN; 1380dst = R4.NaN; 1688value = R4.NaN;
Data\RowCursorUtils.cs (2)
409dst = Single.NaN; 443editor.Values[kv.Key] = Single.NaN;
DataLoadSave\Database\DatabaseLoaderCursor.cs (3)
346return (ref float value) => value = DataReader.IsDBNull(columnIndex) ? float.NaN : DataReader.GetFloat(columnIndex); 629editor.Values[i] = DataReader.IsDBNull(columnIndex) ? float.NaN : DataReader.GetFloat(columnIndex); 635editor.Values[i++] = DataReader.IsDBNull(columnIndex) ? float.NaN : DataReader.GetFloat(columnIndex);
EntryPoints\EntryPointNode.cs (4)
469string stageId = "", float cost = float.NaN, string label = null, string group = null, string weight = null, 563float cost = float.NaN) 597float cost = float.NaN) 913var cost = node[FieldNames.Cost] == null ? float.NaN : node[FieldNames.Cost].Value<float>();
Evaluators\AnomalyDetectionEvaluator.cs (1)
256thresholdAtK = thresholdAtP = thresholdAtNumPos = Single.NaN;
Evaluators\BinaryClassifierEvaluator.cs (2)
638_probGetter = (ref Single value) => value = Single.NaN; 1161ValueGetter<Single> nanGetter = (ref Single value) => value = Single.NaN;
Evaluators\ClusteringEvaluator.cs (1)
508_labelGetter = (ref Single value) => value = Single.NaN;
Evaluators\MulticlassClassificationEvaluator.cs (1)
725(ref float dst) => dst = float.NaN;
Evaluators\QuantileRegressionEvaluator.cs (1)
392ValueGetter<float> nanGetter = (ref float value) => value = Single.NaN;
Evaluators\RankingEvaluator.cs (2)
446_currentQueryWeight = Single.NaN; 520_currentQueryWeight = Single.NaN;
Evaluators\RegressionEvaluator.cs (1)
280ValueGetter<float> nan = (ref float value) => value = Single.NaN;
Microsoft.ML.Ensemble (1)
OutputCombiners\BaseMultiCombiner.cs (1)
103editor.Values[i] = Single.NaN;
Microsoft.ML.Fairlearn (8)
Reductions\UtilityParity.cs (8)
33public UtilityParity(float differenceBound = Single.NaN, float ratioBond = Single.NaN, float ratioBoundSlack = 0.0f) 35if (Single.NaN.Equals(differenceBound) && Single.NaN.Equals(ratioBond)) 40else if (!Single.NaN.Equals(differenceBound) && Single.NaN.Equals(ratioBond)) 45else if (Single.NaN.Equals(differenceBound) && !Single.NaN.Equals(ratioBond))
Microsoft.ML.FastTree (3)
RandomForestRegression.cs (1)
77return float.NaN;
TreeEnsembleFeaturizer.cs (2)
761dst = Single.NaN; 781dst = Single.NaN;
Microsoft.ML.Mkl.Components (1)
OlsLinearRegression.cs (1)
771Double[] standardErrors = null, Double[] tValues = null, Double[] pValues = null, Double rSquared = 1, Double rSquaredAdjusted = float.NaN)
Microsoft.ML.Parquet (1)
ParquetLoader.cs (1)
705public void Conv(in float? src, ref Single dst) => dst = src ?? Single.NaN;
Microsoft.ML.Recommender (1)
MatrixFactorizationPredictor.cs (1)
277dst = float.NaN;
Microsoft.ML.ResultProcessor (1)
ResultProcessor.cs (1)
947perFoldMetrics[metricValues.Key] = new ResultMetric(float.NaN)
Microsoft.ML.Samples (18)
Dynamic\DataOperations\FilterRowsByMissingValues.cs (3)
22new DataPoint(){ Feature1 = 21, Feature2 = new [] { 1, 2, float.NaN} 26new DataPoint(){ Feature1 = float.NaN, Feature2 = new [] { 1, 2, 27float.NaN} }
Dynamic\Transforms\FeatureSelection\SelectFeaturesBasedOnCount.cs (2)
87NumericVector = new float[] { 4, float.NaN, 6 }, 102NumericVector = new float[] { 4, 0, float.NaN },
Dynamic\Transforms\FeatureSelection\SelectFeaturesBasedOnCountMultiColumn.cs (3)
87NumericVector = new float[] { 4, float.NaN, 6 }, 102NumericVector = new float[] { 4, float.NaN, float.NaN },
Dynamic\Transforms\IndicateMissingValues.cs (2)
21new DataPoint(){ Features = new float[3] {0, float.NaN, 1} }, 22new DataPoint(){ Features = new float[3] {-1, float.NaN, -3} },
Dynamic\Transforms\IndicateMissingValuesMultiColumn.cs (3)
22new DataPoint(){ Features1 = new float[3] {0, float.NaN, 1}, 23Features2 = new float[2] {float.NaN, 1} }, 25new DataPoint(){ Features1 = new float[3] {-1, float.NaN, -3},
Dynamic\Transforms\ReplaceMissingValues.cs (2)
24new DataPoint(){ Features = new float[3] {0, float.NaN, 1} }, 26new DataPoint(){ Features = new float[3] {-1, float.NaN, -3} },
Dynamic\Transforms\ReplaceMissingValuesMultiColumn.cs (3)
23new DataPoint(){ Features1 = new float[3] {0, float.NaN, 1}, 26new DataPoint(){ Features1 = new float[3] {-1, float.NaN, -3}, 27Features2 = new float[2] {-1, float.NaN} },
Microsoft.ML.SamplesUtils (1)
SamplesDatasetUtils.cs (1)
318float value = float.NaN;
Microsoft.ML.StandardTrainers (2)
Optimizer\LineSearch.cs (1)
292_step = Value = float.NaN;
Standard\Simple\SimpleTrainers.cs (1)
292float prob = prob = pos + neg > 0 ? (float)(pos / (pos + neg)) : float.NaN;
Microsoft.ML.TestFramework (1)
DataPipe\TestDataPipe.cs (1)
23private static float[] _dataFloat = new float[] { -0.0f, 0, 1, -1, 2, -2, Single.NaN, Single.MinValue,
Microsoft.ML.Tests (35)
ExpressionLanguageTests\ExpressionLanguageTests.cs (1)
538return R4.NaN;
OnnxConversionTest.cs (2)
1157new DataPoint() { Features = new float[3] {0, float.NaN, 1}, }, 1158new DataPoint() { Features = new float[3] {-1, float.NaN, float.PositiveInfinity}, },
TextLoaderTests.cs (7)
1021Assert.Equal(Single.NaN, feature); 1100Assert.NotEqual(Single.NaN, featuresPeriodArray[i]); 1107Assert.Equal(Single.NaN, featuresPeriodArray[i]); 1112Assert.Equal(Single.NaN, featuresPeriodArray[i]); 1113Assert.NotEqual(Single.NaN, featuresCommaArray[i]); 1118Assert.NotEqual(Single.NaN, featuresPeriodArray[i]); 1119Assert.Equal(Single.NaN, featuresCommaArray[i]);
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (1)
796rowWithFloat.FloatLabel = rowWithKey.KeyLabel == 0 ? float.NaN : rowWithKey.KeyLabel - 1;
Transformers\ConvertTests.cs (2)
205ConvA = new float[] { float.NaN, float.NaN },
Transformers\HashTests.cs (2)
305HashTestCore(float.NaN, NumberDataViewType.Single, 0, 0, 0, 0, 0); 379new TestClass() { A = float.NaN, B = 3, C = 12 }
Transformers\NAIndicatorTests.cs (9)
40new TestClass() { A = float.NaN, B = double.NaN, C = new float[2]{ float.NaN, float.NaN } , D = new double[2]{ double.NaN,double.NaN}}, 68new TestClass() { A = float.NaN, B = double.NaN, C = new float[2]{ float.NaN, float.NaN } , D = new double[2]{ double.NaN,double.NaN}}, 131new TestClass() { A = float.NaN, B = double.NaN, C = new float[2]{ float.NaN, float.NaN } , D = new double[2]{ double.NaN,double.NaN}},
Transformers\NAReplaceTests.cs (11)
60new TestClass { A = 2f, B = 2d, C = new float[] { float.NaN, 9f }, D = new double[] { double.NaN, 9f } }, 61new TestClass { A = float.NaN, B = double.NaN, C = new float[] { 2f, float.NaN }, D = new double[] { 2f, double.NaN } }, 63new TestClass{ A = float.NaN, B = double.NaN, C = new float[] { 1f, float.NaN }, D = new double[] { 1f, double.NaN } }, 105new TestClass() { A = float.NaN, B = double.NaN, C= new float[2]{ float.NaN, float.NaN } , D = new double[2]{ double.NaN,double.NaN}}, 163new TestClass() { A = float.NaN, B = double.NaN, C= new float[2]{ float.NaN, float.NaN } , D = new double[2]{ double.NaN,double.NaN}},
Microsoft.ML.TimeSeries (9)
AdaptiveSingularSpectrumSequenceModeler.cs (1)
192public Single LastValue { get { return _buffer.Count > 0 ? _buffer[_buffer.Count - 1] : Single.NaN; } }
ExponentialAverageTransform.cs (1)
114output = Single.NaN;
MovingAverageTransform.cs (5)
142return nb == 0 ? Single.NaN : sumValues / nb; 170return sumWeights != 0 ? sumValues / sumWeights : Single.NaN; 234return nb == 0 ? Single.NaN : currentSum / nb; 240return nb == 0 ? Single.NaN : currentSum / nb; 266output = Single.NaN;
PValueTransform.cs (1)
117dst = Single.NaN;
SequentialForecastingTransformBase.cs (1)
301editor.Values[i] = float.NaN;
Microsoft.ML.Tokenizers.Tests (1)
SentencePieceTests.cs (1)
651MakePiece("nan_score", float.NaN, 1),
Microsoft.ML.Transforms (12)
Expression\BuiltinFunctions.cs (4)
53return R4.NaN; 383return R4.NaN; 433return R4.NaN; 644return R4.NaN;
Expression\LambdaBinder.cs (1)
788return R4.NaN;
MissingValueReplacing.cs (1)
887node.AddAttribute("replaced_value_float", Single.NaN);
SvmLight\SvmLightLoader.cs (3)
118output.IsComment = float.NaN; 173intermediate.Label = float.NaN; 174intermediate.Weight = float.NaN;
Text\LdaTransform.cs (1)
505editor.Values[k] = float.NaN;
Text\WordEmbeddingsExtractor.cs (2)
715float[] firstValue = wordsInFirstLine.Skip(1).Select(x => float.TryParse(x, out temp) ? temp : Single.NaN).ToArray(); 716if (!firstValue.Contains(Single.NaN))
PresentationCore (1)
System\Windows\Input\Stylus\Common\StylusPoint.cs (1)
82(pressureFactor == Single.NaN || pressureFactor < 0.0f || pressureFactor > 1.0f))
ReachFramework (1)
AlphaFlattener\Utility.cs (1)
2285return NormalizeColorChannel(value, float.NaN);
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
83{ float.NaN, nameof(float.NaN) },
System.Numerics.Tensors (39)
System\Numerics\Tensors\TensorPrimitives.Single.cs (39)
23/// If a value is equal to <see cref="float.NaN"/>, the result stored into the corresponding destination location is the original NaN value with the sign bit removed. 42/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 59/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 80/// If any of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 100/// If any of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 120/// If any of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 137/// If a value is equal to <see cref="float.NaN"/>, the result stored into the corresponding destination location is also NaN. 161/// If any element in either input tensor is equal to <see cref="float.NegativeInfinity"/>, <see cref="float.PositiveInfinity"/>, or <see cref="float.NaN"/>, 189/// If any element in either input tensor is equal to <see cref="float.NaN"/>, NaN is returned. 219/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 236/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 258/// If any of the input elements is equal to <see cref="float.NaN"/>, the resulting value is also NaN. 278/// If a value equals <see cref="float.NaN"/> or <see cref="float.PositiveInfinity"/>, the result stored into the corresponding destination location is set to NaN. 294/// The determination of the maximum element matches the IEEE 754:2019 `maximum` function. If any value equal to <see cref="float.NaN"/> 310/// The determination of the maximum magnitude matches the IEEE 754:2019 `maximumMagnitude` function. If any value equal to <see cref="float.NaN"/> 327/// The determination of the minimum element matches the IEEE 754:2019 `minimum` function. If any value equal to <see cref="float.NaN"/> 343/// The determination of the minimum magnitude matches the IEEE 754:2019 `minimumMagnitude` function. If any value equal to <see cref="float.NaN"/> 366/// If a value is negative or equal to <see cref="float.NaN"/>, the result stored into the corresponding destination location is set to NaN. 389/// If a value is negative or equal to <see cref="float.NaN"/>, the result stored into the corresponding destination location is set to NaN. 407/// The determination of the maximum element matches the IEEE 754:2019 `maximum` function. If any value equal to <see cref="float.NaN"/> 431/// The determination of the maximum element matches the IEEE 754:2019 `maximum` function. If either value is equal to <see cref="float.NaN"/>, 448/// The determination of the maximum magnitude matches the IEEE 754:2019 `maximumMagnitude` function. If any value equal to <see cref="float.NaN"/> 484/// The determination of the minimum element matches the IEEE 754:2019 `minimum` function. If any value is equal to <see cref="float.NaN"/> 508/// The determination of the maximum element matches the IEEE 754:2019 `maximum` function. If either value is equal to <see cref="float.NaN"/>, 525/// The determination of the minimum magnitude matches the IEEE 754:2019 `minimumMagnitude` function. If any value equal to <see cref="float.NaN"/> 548/// The determination of the maximum magnitude matches the IEEE 754:2019 `minimumMagnitude` function. If either value is equal to <see cref="float.NaN"/>, 573/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 591/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 612/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 633/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 653/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 669/// If any of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 685/// If any of the input values is equal to <see cref="float.NaN"/>, the result value is also NaN. 701/// If any of the input values is equal to <see cref="float.NaN"/>, the result value is also NaN. 815/// If a value is equal to <see cref="float.NegativeInfinity"/>, <see cref="float.PositiveInfinity"/>, or <see cref="float.NaN"/>, 877/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 894/// If either of the element-wise input values is equal to <see cref="float.NaN"/>, the resulting element-wise value is also NaN. 905/// If any of the values in the input is equal to <see cref="float.NaN"/>, the result is also NaN. 969/// If a value is equal to <see cref="float.NaN"/>, the corresponding destination location is set to NaN.
System.Private.CoreLib (27)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Float.cs (1)
40return TryParseAsSpecialFloatingPoint(source, float.PositiveInfinity, float.NegativeInfinity, float.NaN, out value, out bytesConsumed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MathF.cs (3)
157return float.NaN; 233return float.NaN; 238return float.NaN;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (1)
96get => Create(float.NaN);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (1)
109get => Create(float.NaN);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (3)
121/// <summary>Gets a vector whose elements are equal to <see cref="float.NaN" />.</summary> 122/// <value>A vector whose elements are equal to <see cref="float.NaN" /> (that is, it returns the vector <c>Create(float.NaN)</c>).</value> 126get => Create(float.NaN);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (4)
760result = TVectorSingle.ConditionalSelect(nanMask, TVectorSingle.Create(float.NaN), result); 1124TVectorSingle.Create(float.NaN), 1440TVectorSingle.Create(float.NaN), 3186result = TVectorSingle.ConditionalSelect(outOfRange, TVectorSingle.Create(float.NaN), result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (14)
814static float IFloatingPointIeee754<float>.NaN => NaN; 1580result = NaN; 1613result = NaN; 1633result = NaN; 1647result = NaN; 1657result = int.IsOddInteger(n) ? NegativeInfinity : NaN; 1678result = NaN; 1692result = NaN; 1702result = int.IsOddInteger(n) ? -0.0f : NaN; 1858result = NaN; 2000sinPi = NaN; 2001cosPi = NaN; 2084result = NaN; 2176result = NaN;
System.Runtime.Numerics (1)
System\Numerics\Complex.cs (1)
1773float actualResult = (value.m_imaginary != 0) ? float.NaN : (float)value.m_real;
System.Text.Json (1)
System\Text\Json\Reader\JsonReaderHelper.cs (1)
337value = float.NaN;
System.Text.Json.SourceGeneration (1)
src\runtime\src\libraries\Common\src\SourceGenerators\CSharpSyntaxUtilities.cs (1)
43case float.NaN:
System.Windows.Input.Manipulations (25)
System\Windows\Input\Manipulations\InertiaExpansionBehavior2D.cs (8)
19private float desiredDeceleration = float.NaN; 20private float desiredExpansionX = float.NaN; 21private float desiredExpansionY = float.NaN; 22private float initialVelocityX = float.NaN; 23private float initialVelocityY = float.NaN; 95() => { this.desiredDeceleration = value; this.desiredExpansionX = this.desiredExpansionY = float.NaN; }, 136() => { this.desiredExpansionX = value; this.desiredDeceleration = float.NaN; }, 177() => { this.desiredExpansionY = value; this.desiredDeceleration = float.NaN; },
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (2)
489this.initialExpansion.AbsoluteOffset = (behavior == null) ? float.NaN : behavior.DesiredExpansionX; 490this.initialExpansion.Velocity = (behavior == null) ? float.NaN : behavior.InitialVelocityX;
System\Windows\Input\Manipulations\InertiaRotationBehavior2D.cs (5)
15private float desiredDeceleration = float.NaN; 16private float desiredRotation = float.NaN; 17private float initialVelocity = float.NaN; 48() => { this.desiredDeceleration = value; this.desiredRotation = float.NaN; }, 91() => { this.desiredRotation = value; this.desiredDeceleration = float.NaN; },
System\Windows\Input\Manipulations\InertiaTranslationBehavior2D.cs (6)
16private float desiredDeceleration = float.NaN; 17private float desiredDisplacement = float.NaN; 18private float initialVelocityX = float.NaN; 19private float initialVelocityY = float.NaN; 49() => { this.desiredDeceleration = value; this.desiredDisplacement = float.NaN; }, 86() => { this.desiredDisplacement = value; this.desiredDeceleration = float.NaN; },
System\Windows\Input\Manipulations\ManipulationPivot2D.cs (3)
57private float x = float.NaN; 58private float y = float.NaN; 59private float radius = float.NaN;
System\Windows\Input\Manipulations\ManipulationSequence.cs (1)
258float result = float.NaN;