Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d0d7f0b

Browse files
cclausspre-commit-ci[bot]
andauthored
maths/radix2_fft.py: Fix calculation for Python 3.14 (TheAlgorithms#12772)
* maths/radix2_fft.py: Fix calculation for Python 3.14 As suggested at: * TheAlgorithms#12729 (comment) * TheAlgorithms#12710 (comment) @MaximSmolskiy @KirilBangachev @skirpichev Careful review, please. I am just implementing the suggestion, but I do not have any expertise in this area. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change test results * GitHub Actions: Rename job from build to directory_writer It is confusing to have two jobs named `build`. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e26c388 commit d0d7f0b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎.github/workflows/directory_writer.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: directory_writer
44
on: [push]
55
jobs:
6-
build:
6+
directory_writer:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4

‎maths/radix2_fft.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ class FFT:
4040
4141
Print product
4242
>>> x.product # 2x + 3x^2 + 8x^3 + 4x^4 + 6x^5
43-
[(-0+0j), (2+0j), (3+0j), (8+0j), (6+0j), (8+0j)]
43+
[(-0-0j), (2+0j), (3-0j), (8-0j), (6+0j), (8+0j)]
4444
4545
__str__ test
4646
>>> print(x)
4747
A = 0*x^0 + 1*x^1 + 2*x^0 + 3*x^2
4848
B = 0*x^2 + 1*x^3 + 2*x^4
49-
A*B = 0*x^(-0+0j) + 1*x^(2+0j) + 2*x^(3+0j) + 3*x^(8+0j) + 4*x^(6+0j) + 5*x^(8+0j)
49+
A*B = 0*x^(-0-0j) + 1*x^(2+0j) + 2*x^(3-0j) + 3*x^(8-0j) + 4*x^(6+0j) + 5*x^(8+0j)
5050
"""
5151

5252
def __init__(self, poly_a=None, poly_b=None):
@@ -147,7 +147,9 @@ def __multiply(self):
147147
inverce_c = new_inverse_c
148148
next_ncol *= 2
149149
# Unpack
150-
inverce_c = [round(x[0].real, 8) + round(x[0].imag, 8) * 1j for x in inverce_c]
150+
inverce_c = [
151+
complex(round(x[0].real, 8), round(x[0].imag, 8)) for x in inverce_c
152+
]
151153

152154
# Remove leading 0's
153155
while inverce_c[-1] == 0:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /