Update numerical_methods/fast_fourier_transform.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Ameya Chawla
2021-10-21 08:11:47 +05:30
committed by GitHub
parent 7cccbd3d87
commit 6a9b4a312b

View File

@@ -36,8 +36,9 @@ std::complex<double> *FastFourierTransform(std::complex<double> *p,
uint64_t n) {
double pi = 2 * asin(1.0); /// Declaring value of pi
if (n == 1)
if (n == 1) {
return p; /// Base Case To return
}
std::complex<double> om = std::complex<double>(
cos(2 * pi / n), sin(2 * pi / n)); /// Calculating value of omega