https://issues.dlang.org/show_bug.cgi?id=12974
Issue ID: 12974 Summary: Integer constant exponentiation gives wrong value Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: Phobos Assignee: nob...@puremagic.com Reporter: safety0ff.b...@gmail.com Applying the unit tests from my own integer power function: import std.math; void main() { ulong uimax = uint.max; assert(uimax^^2uL == 18446744065119617025uL); //passes ulong three = 3uL; assert(three^^40uL == 12157665459056928801uL); // passes assert((cast(ulong)uint.max)^^40uL == 12157665459056928801uL); // error assert((3uL)^^40uL == 12157665459056928801uL); // error } --