mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-09 23:53:18 +08:00
Update numerical_methods/fast_fourier_transform.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user