Skip to content

Update System.Numerics.Complex and Complex<T> to be IEEE 754 compliant #128173

@tannergooding

Description

@tannergooding

The System.Numerics.Complex type was introduced in .NET Framework 4.0. It was not originally implemented to be IEEE 754 compliant and deviates from the established standards that C and other languages specify for correct behavior.

We are introducing System.Numerics.Complex in .NET 11 #127333 and so should go through the effort of updating the implementation to be IEEE 754 compliant with regards to the various NaN, +/-Infinity, and +/- edge cases.

Noting that while IEEE 754 doesn't itself explicitly call out the behavior for complex numbers and somewhat leaves it "out of scope", it does provide enough information around intent and there are likewise formal mathematical models and behaviors documented for the "extended real number system" that make the "spec compliant" behaviors obvious. These behaviors are explicitly called out and documented in Annex G - IEC 60559 compatible complex arithmetic of the C Language standard as well, under the same general rationale, and are the "de facto" standard for behavior here.

Metadata

Metadata

Assignees

Labels

area-System.Numericsbreaking-changeIssue or PR that represents a breaking API or functional change over a previous release.needs-breaking-change-doc-createdBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions