chore(math/exponential): avoid import constants if not InlineAsm_X87

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
Luís Ferreira 2022-05-02 00:15:58 +01:00 committed by The Dlang Bot
parent 19c6e8d251
commit a56287dd8b

View file

@ -968,10 +968,10 @@ if (isUnsigned!F && isUnsigned!G && isUnsigned!H)
pragma(inline, true)
real exp(real x) @trusted pure nothrow @nogc // TODO: @safe
{
import std.math.constants : LOG2E;
version (InlineAsm_X87)
{
import std.math.constants : LOG2E;
// e^^x = 2^^(LOG2E*x)
// (This is valid because the overflow & underflow limits for exp
// and exp2 are so similar).