diff --git a/YamlDotNet/Serialization/NodeDeserializers/ScalarNodeDeserializer.cs b/YamlDotNet/Serialization/NodeDeserializers/ScalarNodeDeserializer.cs index c0d5b9c0..fd7bcf19 100644 --- a/YamlDotNet/Serialization/NodeDeserializers/ScalarNodeDeserializer.cs +++ b/YamlDotNet/Serialization/NodeDeserializers/ScalarNodeDeserializer.cs @@ -394,7 +394,7 @@ private static object CastInteger(ulong number, TypeCode typeCode) else if (double.TryParse(v, NumberStyles.Float, formatter.NumberFormat, out var doubleValue)) { var floatValue = (float)doubleValue; - if (!float.IsNaN(floatValue) && !float.IsInfinity(floatValue)) // .NET 6 or later support float.IsNormal + if (!float.IsNaN(floatValue) && !float.IsInfinity(floatValue)) { result = floatValue; }