Skip to content

Commit

Permalink
Merge pull request #530 from pi-vo/positive-infinity
Browse files Browse the repository at this point in the history
Fix positive infinity in TypeModel.
  • Loading branch information
mganss authored Oct 22, 2024
2 parents 9e2b96d + ba63a48 commit 0f45608
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion XmlSchemaClassGenerator/TypeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ public override CodeExpression GetDefaultValueFor(string defaultString, bool att
else if (type == typeof(double) && !string.IsNullOrWhiteSpace(defaultString))
{
if (defaultString.Equals("inf", StringComparison.OrdinalIgnoreCase))
return new CodePrimitiveExpression(double.NegativeInfinity);
return new CodePrimitiveExpression(double.PositiveInfinity);
else if (defaultString.Equals("-inf", StringComparison.OrdinalIgnoreCase))
return new CodePrimitiveExpression(double.NegativeInfinity);
}
Expand Down

0 comments on commit 0f45608

Please sign in to comment.