I think this bug might have the same root cause as bug 5565. It was reduced from completely different code and I don't really understand the root cause of either very well, though, so I'm filing a separate bug report in case I'm wrong. Even if it is related to 5565, this test case is simpler. import std.math, std.stdio; double fun(ulong k, ulong n, double p) { return pow(1.0 - p, cast(double) n); } void main() { // Should print 0.8 ^ 10 = 0.1073741824. Prints 0.956352. writeln(fun(0, 10, 0.2)); }
Argh, again I forgot to mention, this test case does not reproduce the bug if inlining is enabled, probably because fun() gets inlined. In the larger case I reduced it from, inlining could be enabled and the bug would still be reproduced.
https://github.com/D-Programming-Language/dmd/commit/4a61292e28a47bd7808eb4b1ff459537599beec6 https://github.com/D-Programming-Language/dmd/commit/b496185f71837483bf478315a8a62c53d6eae174
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル