From eb17014c9b036a8bf4b1754c504ef7b49d738427 Mon Sep 17 00:00:00 2001 From: Carl Burkert Date: Mon, 20 Sep 2021 10:26:09 +0200 Subject: [PATCH] Fix conversion warnings in logspace --- src/stdlib_math_logspace.fypp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/stdlib_math_logspace.fypp b/src/stdlib_math_logspace.fypp index f43169177..fd55df21c 100644 --- a/src/stdlib_math_logspace.fypp +++ b/src/stdlib_math_logspace.fypp @@ -45,21 +45,33 @@ contains module procedure ${RName}$ ${t1}$ :: exponents(max(n, 0)) exponents = linspace(start, end, n) - res = base ** exponents + #: if t1[0] == 'r' + res = base ** exponents + #: else + res = cmplx(base, kind=${k1}$) ** cmplx(exponents, kind=${k1}$) + #: endif end procedure #:set RName = rname("logspace", 1, t1, k1, "n_cbase") module procedure ${RName}$ ${t1}$ :: exponents(max(n, 0)) exponents = linspace(start, end, n) - res = base ** exponents + #: if t1[0] == 'r' + res = real(base ** cmplx(exponents, kind=${k1}$)) + #: else + res = base ** cmplx(exponents, kind=${k1}$) + #: endif end procedure #:set RName = rname("logspace", 1, t1, k1, "n_ibase") module procedure ${RName}$ ${t1}$ :: exponents(max(n, 0)) exponents = linspace(start, end, n) - res = base ** exponents + #: if t1[0] == 'r' + res = base ** exponents + #: else + res = cmplx(base, kind=${k1}$) ** cmplx(exponents, kind=${k1}$) + #: endif end procedure #:endfor #! Integer support: