From 65b103fc08c5a58f3b0c2b56ac8650ca8e678109 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sat, 23 May 2015 14:05:03 +0200 Subject: [PATCH] Relax compile-time assertion in gammafunction to runtime --- std/internal/math/gammafunction.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/std/internal/math/gammafunction.d b/std/internal/math/gammafunction.d index 9515212bd83..b630538647f 100644 --- a/std/internal/math/gammafunction.d +++ b/std/internal/math/gammafunction.d @@ -1597,8 +1597,10 @@ unittest { real logmdigammaInverse(real y) { import std.numeric: findRoot; - enum maxY = logmdigamma(real.min_normal); - static assert(maxY > 0 && maxY <= real.max); + // FIXME: should be returned back to enum. + // Fix requires CTFEable `log` on non-x86 targets (check both LDC and GDC). + immutable maxY = logmdigamma(real.min_normal); + assert(maxY > 0 && maxY <= real.max); if (y >= maxY) {