Skip to content

gh-149924: Add edge case tests for isclose() function in test_cmath.py#149948

Open
manoj-km24 wants to merge 1 commit into
python:mainfrom
manoj-km24:add-tests-for-isclose-cmath-py
Open

gh-149924: Add edge case tests for isclose() function in test_cmath.py#149948
manoj-km24 wants to merge 1 commit into
python:mainfrom
manoj-km24:add-tests-for-isclose-cmath-py

Conversation

@manoj-km24
Copy link
Copy Markdown
Contributor

@manoj-km24 manoj-km24 commented May 17, 2026

In Lib/test/test_cmath.py, the isclose() function misses certain test cases for special complex numbers with infinity and Nan. As docs tell:

-inf, inf and NaN behave similarly to the IEEE 754 Standard.
That is, NaN is not close to anything, even itself.
inf and -inf are only close to themselves.
This applies for complex numbers as well (inf + infj , -inf - infj and NaN + NaNj behave in the same way).
This PR adds tests for these edge cases.

@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels May 17, 2026
@picnixz picnixz changed the title gh-149924 :Add edge case tests for isclose() function in test_cmath.py gh-149924: Add edge case tests for isclose() function in test_cmath.py May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants