dotnet / dotnet/dotnet-api-docs

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

Open
#12,041 2 comments 0 reactions 0 assignees View on GitHub
area-System.Runtime untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.