Skip to content

Math.Atan2(double,double) documentation incorrect for infinite values #12041

@DoktorDemento

Description

@DoktorDemento

Type of issue

Outdated article

Description

The documentation for .NET 9.0 is the same as the documentation for .NET Framework 4.8.1. In particular, the lines:

If x or y is NaN, or if x and y are either PositiveInfinity or NegativeInfinity, the method returns NaN.

This is correct for .NET Framework 4.8.1, but infinite values do not return double.NaN in .NET 9.0 at least:

y x .NET Framework 4.8.1 .NET 9.0
double.NegativeInfinity double.NegativeInfinity double.NaN - 3π / 4
double.NegativeInfinity double.PositiveInfinity double.NaN - π / 4
double.PositiveInfinity double.NegativeInfinity double.NaN 3π / 4
double.PositiveInfinity double.PositiveInfinity double.NaN π / 4

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.math.atan2?view=net-9.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System/Math.xml

Document Version Independent Id

461d1d25-e500-02fd-3951-69d1e3ca8f0c

Platform Id

8e8eb576-f9c1-a5ab-514a-735884295c05

Article author

@dotnet-bot

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions