Skip to content

Conversation

@skirpichev
Copy link
Member

@skirpichev skirpichev commented Jul 17, 2024

As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 + iNaN) should return NaN ± i pi/2, not NaN + iNaN. This patch fixes cmath's code to do same.

glibc patch: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=5244527da1bfa751492e146d3e6ae128c59bfcc4

As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 +
iNaN) should return NaN ± i pi/2, not NaN + iNaN.  This patch
fixes cmath's code to do same.
Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. This LGTM.

I don't think this should be backported - it's not behaviour that I'd want to change in a bugfix release. It's enough that CPython will eventually (Python >= 3.14) do the right thing.

@mdickinson mdickinson merged commit 3462a80 into python:main Aug 4, 2024
@skirpichev skirpichev deleted the fix-acosh-121889 branch August 4, 2024 09:26
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Aug 7, 2024
As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 +
iNaN) should return NaN ± i pi/2, not NaN + iNaN.  This patch
fixes cmath's code to do same.
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 +
iNaN) should return NaN ± i pi/2, not NaN + iNaN.  This patch
fixes cmath's code to do same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants