Skip to content

gh-149924 :Increase test coverage for isclose() function with complex numbers#149923

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

gh-149924 :Increase test coverage for isclose() function with complex numbers#149923
manoj-km24 wants to merge 1 commit into
python:mainfrom
manoj-km24:add-tests-cmath-py

Conversation

@manoj-km24
Copy link
Copy Markdown
Contributor

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

In Lib/test/test_cmath.py, the isclose() function misses certain special 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 additional tests for these edge cases.

@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting review labels May 16, 2026
@manoj-km24 manoj-km24 changed the title Increase test coverage for isclose() function with complex numbers gh-149924 :Increase test coverage for isclose() function with complex numbers May 16, 2026
@aisk aisk added the skip news label May 16, 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