From 68156fa62c6284d8a91dcb84378cecf1c72b6056 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 15 Mar 2023 18:32:43 +0100 Subject: [PATCH] Complex number handling other than MSVC --- src/maths/cmaths/cmath1.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/maths/cmaths/cmath1.c b/src/maths/cmaths/cmath1.c index d90128882..f0ecf0821 100644 --- a/src/maths/cmaths/cmath1.c +++ b/src/maths/cmaths/cmath1.c @@ -874,8 +874,13 @@ cx_atanh(void* data, short int type, int length, int* newlength, short int* newt ngcomplex_t* cc = (ngcomplex_t*)data; int i; for (i = 0; i < length; i++) { +#ifdef _MSC_VER _Dcomplex midin = _Cbuild(cc->cx_real, cc->cx_imag); _Dcomplex midout = catanh(midin); +#else + double complex midin = cc->cx_real + _Complex_I * cc->cx_imag; + double complex midout = catanh(midin); +#endif d[i].cx_real = creal(midout); d[i].cx_imag = cimag(midout); }