From 60d19cd9ab47c0bf3005f655f8a75e1afd9ac628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Sat, 16 Feb 2019 10:39:35 +0100 Subject: [PATCH] numbers: don't assume ECL is always built with longfloat Fixes regression with windows builds (and all buidls without longfloat). --- src/c/numbers/expt.d | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/c/numbers/expt.d b/src/c/numbers/expt.d index b1ad691c0..efbd27317 100644 --- a/src/c/numbers/expt.d +++ b/src/c/numbers/expt.d @@ -102,16 +102,17 @@ ecl_expt(cl_object x, cl_object y) z = x; if (!ecl_plusp(ty==t_complex?y->complex.real:y)) z = ecl_divide(ecl_make_fixnum(1), z); - } else if (tx == t_singlefloat && ty == t_singlefloat - && ecl_single_float(x) >= 0.0f) { + } else if (tx == t_singlefloat && ty == t_singlefloat && ecl_single_float(x) >= 0.0f) { z = ecl_make_single_float(powf(ecl_single_float(x), ecl_single_float(y))); - } else if (tx == t_doublefloat && ty == t_doublefloat - && ecl_double_float(x) >= 0.0) { + } else if (tx == t_doublefloat && ty == t_doublefloat && ecl_double_float(x) >= 0.0) { z = ecl_make_double_float(pow(ecl_double_float(x), ecl_double_float(y))); - } else if (tx == t_longfloat && ty == t_longfloat - && ecl_long_float(x) >= 0.0l) { + } +#ifdef ECL_LONG_FLOAT + else if (tx == t_longfloat && ty == t_longfloat && ecl_long_float(x) >= 0.0l) { z = ecl_make_long_float(powl(ecl_long_float(x), ecl_long_float(y))); - } else if (ty != t_fixnum && ty != t_bignum) { + } +#endif + else if (ty != t_fixnum && ty != t_bignum) { /* The following could be just z = ecl_log1(x); however, Maxima expects EXPT to have double accuracy