Closed
Description
See the required changes https://github.com/TheAlgorithms/Python/pull/12710/files#r2080117333
Repository commit
Same as #12710
Python version (python --version)
Python 3.14 beta 1
Dependencies version (pip freeze)
Same as:
Expected behavior
Doctest results do not need to change between Python 3.13 and 3.14 beta.
Actual behavior
See changes required in:
Activity
[-]Help requested: Why do maths/radix2_fft.py test results change on Python 3.14 beta?[/-][+]Help wanted: Why do maths/radix2_fft.py test results change on Python 3.14 beta?[/+]MaximSmolskiy commentedon May 13, 2025
@cclauss In Python 3.14 Release Notes (https://docs.python.org/3.14/whatsnew/3.14.html) there are mentions of changes related to complex numbers:
This may be the reason for changes in the doctests.
cclauss commentedon May 14, 2025
@skirpichev
skirpichev commentedon May 14, 2025
JFR, above pr was merged not before latest beta. Did you test alphas?
cclauss commentedon May 14, 2025
https://github.com/TheAlgorithms/Python/actions/runs/14991034991/job/42114180325#step:5:20 This is beta 1.
Or is uv using a different Py3.14?
skirpichev commentedon May 14, 2025
My question was did you test 3.14 alphas?
skirpichev commentedon May 14, 2025
Anyway, so far I can guess this might be related to:
Probably, you want rather
complex(round(x[0].real, 8), round(x[0].imag, 8))
. But with above pattern you can get different answers on 3.14 and 3.13. Example:Obviously, the last answer is incorrect as a replacement of
complex(1, -0.0)
.maths/radix2_fft.py: Fix calculation for Python 3.14
maths/radix2_fft.py: Fix calculation for Python 3.14 (#12772)