diff options
Diffstat (limited to 'src/main/Complex.c')
-rw-r--r-- | src/main/Complex.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/Complex.c b/src/main/Complex.c index e0f6b4d0..207fa265 100644 --- a/src/main/Complex.c +++ b/src/main/Complex.c @@ -491,7 +491,7 @@ cctk_complex CCTK_Cmplx##Sqrt (cctk_complex complex_number) \ x = fabs (complex_number.Re); \ y = fabs (complex_number.Im); \ if (x >= y) \ - { \ + { \ t = y / x; \ w = sqrt (x) * sqrt (0.5 * (1.0 + sqrt (1.0 * t * t))); \ } \ @@ -500,9 +500,9 @@ cctk_complex CCTK_Cmplx##Sqrt (cctk_complex complex_number) \ t = x / y; \ w = sqrt (y) * sqrt (0.5 * (t + sqrt (1.0 * t * t))); \ } \ - \ + \ if (complex_number.Re >= 0.0) \ - { \ + { \ result.Re = w; \ result.Im = complex_number.Im / (2.0 * w); \ } \ |