import std.math; enum foo = atan(1.0); above code failed to compile using DMD32 D Compiler v2.068.0 Building Debug\T38DTest.exe... C:\APP\D\dmd2\windows\bin\..\..\src\phobos\std\math.d(1135): Error: asm statements cannot be interpreted at compile time C:\APP\D\dmd2\windows\bin\..\..\src\phobos\std\math.d(1023): called from here: atan2(x, 1.00000L) C:\APP\D\dmd2\windows\bin\..\..\src\phobos\std\math.d(1087): called from here: atan(cast(real)x) main.d(2): called from here: atan(1.00000)
I hit this problem today. dmd2/linux/bin64/../../src/phobos/std/math.d(5288,22): Error: asm statements cannot be interpreted at compile time source/money.d(716,21): called from here: lrint(x) source/money.d(87,31): called from here: round(cast(real)(x * cast(double)pow10(4)), cast(roundingMode)2) source/money.d(87,25): called from here: to(round(cast(real)(x * cast(double)pow10(4)), cast(roundingMode)2)) And found previous discussion and solution here: https://forum.dlang.org/post/jtlhocbfcignwhbntgrv@forum.dlang.org Not sure if this bug can be fixed. $ dmd --version DMD64 D Compiler v2.092.0 Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved written by Walter Bright on x86_64 GNU/Linux
I cannot reproduce this. This seems to have been fixed.