Bug 18069 – Exponentiation operator ^^ not evaluable at compile time

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2017-12-12T15:40:14Z
Last change time
2017-12-12T22:52:29Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2017-12-12T15:40:14Z
Following code does not compile but should: ``` void main(string[] args) { import std.stdio; enum e = (1.0f / 255.0f) ^^ (1.0f / 2.2f); writeln("e = ", e); } ``` Error is: /usr/local/opt/dmd/include/dlang/dmd/std/math.d(440): Error: y.vu[4] is used before initialized /usr/local/opt/dmd/include/dlang/dmd/std/math.d(413): originally uninitialized here /usr/local/opt/dmd/include/dlang/dmd/std/math.d(4107): called from here: floorImpl(x) /usr/local/opt/dmd/include/dlang/dmd/std/math.d(2373): called from here: floor(x + 0.5L) /usr/local/opt/dmd/include/dlang/dmd/std/math.d(2110): called from here: exp2Impl(x) /usr/local/opt/dmd/include/dlang/dmd/std/math.d(6743): called from here: exp2(yl2x(x, y)) /usr/local/opt/dmd/include/dlang/dmd/std/math.d(6756): called from here: impl(cast(real)x, cast(real)y) test.d(5): called from here: pow(0.00392157, 0.454545) Forum thread: https://forum.dlang.org/thread/[email protected]
Comment #1 by ibuclaw — 2017-12-12T22:52:29Z
*** This issue has been marked as a duplicate of issue 5227 ***