-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix complex's Sufficient Additional Overloads (#791)
* Fixes GH-785, which reported that `arg(real)` was implemented as `return 0;` but `arg(complex)` does actual work for complex numbers with zero imaginary parts. * `norm` should upgrade to `double` before squaring. The difference is observable because `double`'s range is vast. * `conj` and `proj` should return `complex`. * `conj(real)` should behave exactly like `conj(complex)`, returning an imaginary part of negative zero. The difference is technically observable. * `proj(real)` should behave exactly like `proj(complex)`, mapping negative infinity to positive infinity. * Test that float/double/long double aren't "upgraded". * Tests pass for Clang, emit warnings for MSVC.
- Loading branch information
1 parent
430b569
commit 65d98ff
Showing
4 changed files
with
95 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters