www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - CTFE pow()

reply Manu via Digitalmars-d <digitalmars-d puremagic.com> writes:
Does anyone know how to fix this? Can we please do so? It's been a
problem for like 5 years it seems.
It's a bit insane that we can't resolve any non-linear functions at
compile time.
Jan 01 2015
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdan.org> writes:
Manu via Digitalmars-d <digitalmars-d puremagic.com> wrote:
 Does anyone know how to fix this? Can we please do so? It's been a
 problem for like 5 years it seems.
 It's a bit insane that we can't resolve any non-linear functions at
 compile time.
I've been hoping for that too for a long time. Application to memoization tables is immediate and awesome. -- Andrei
Jan 01 2015
parent Shammah Chancellor <anonymous coward.com> writes:
On 2015-01-01 17:59:09 +0000, Andrei Alexandrescu said:

 Manu via Digitalmars-d <digitalmars-d puremagic.com> wrote:
 Does anyone know how to fix this? Can we please do so? It's been a
 problem for like 5 years it seems.
 It's a bit insane that we can't resolve any non-linear functions at
 compile time.
I've been hoping for that too for a long time. Application to memoization tables is immediate and awesome. -- Andrei
I think that SDC can do this already. :D
Jan 12 2015
prev sibling next sibling parent "Xinok" <xinok live.com> writes:
On Thursday, 1 January 2015 at 16:56:24 UTC, Manu via 
Digitalmars-d wrote:
 Does anyone know how to fix this? Can we please do so? It's 
 been a
 problem for like 5 years it seems.
 It's a bit insane that we can't resolve any non-linear 
 functions at
 compile time.
I was looking for a relevant issue in the bug tracker. I stumbled upon issue [1] and pull request [2] which was closed for the following reasons: 1. if(__ctfe) kills inlining in DMD. 2. Other CTFE math can not be implemented until CTFE-able unions. [1] https://issues.dlang.org/show_bug.cgi?id=5227 [2] https://github.com/D-Programming-Language/phobos/pull/2521#issuecomment-56265251
Jan 01 2015
prev sibling parent reply "Martin Nowak" <code dawg.eu> writes:
On Thursday, 1 January 2015 at 16:56:24 UTC, Manu via 
Digitalmars-d wrote:
 Does anyone know how to fix this? Can we please do so? It's 
 been a
 problem for like 5 years it seems.
 It's a bit insane that we can't resolve any non-linear 
 functions at
 compile time.
Oh, we got yl2x recently [1]. So, your code here -> https://github.com/D-Programming-Language/dmd/blob/6fe4b48891ff5d7d171f718b2a4af6ddbb6714ec/src/builtin.c#L183 [1]: https://github.com/D-Programming-Language/dmd/pull/4012
Jan 12 2015
parent "Martin Nowak" <code dawg.eu> writes:
https://issues.dlang.org/show_bug.cgi?id=3749
Jan 12 2015