dotnet-api-docs
dotnet-api-docs copied to clipboard
Math.Atan2(double,double) documentation incorrect for infinite values
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