digitalmars.D - powExpressions work at ctfe
- Stefan Koch (3/3) May 09 2016 At Dconf Manu asked to use pow expressions at CTFE.
- Timon Gehr (9/12) May 09 2016 enum x=2.4^^4.5;
- Stefan Koch (4/17) May 09 2016 I see.
- Stefan Koch (5/25) May 09 2016 okay the workaround would be just to avoid pointer casts.
- Stefan Koch (3/14) May 09 2016 Yet another option is using soft-float for ctfe, that would also
- Jonathan M Davis via Digitalmars-d (4/6) May 09 2016 That's going to be pretty critical in the long run, especially now that ...
- Manu via Digitalmars-d (4/25) May 11 2016 This is almost certainly the correct solution... at least a soft-float
At Dconf Manu asked to use pow expressions at CTFE. Luckily he can. powExpressions work at ctfe.
May 09 2016
On 09.05.2016 11:24, Stefan Koch wrote:At Dconf Manu asked to use pow expressions at CTFE. Luckily he can. powExpressions work at ctfe.enum x=2.4^^4.5; DMD master: ./../../phobos/std/math.d(4857): Error: cannot convert &real to ushort* at compile time ./../../phobos/std/math.d(6113): called from here: isNaN(y) ./../../phobos/std/math.d(6303): called from here: impl(cast(real)x, cast(real)y) ctfepow.d(1): called from here: pow(2.4, 4.5)
May 09 2016
On Monday, 9 May 2016 at 12:24:18 UTC, Timon Gehr wrote:On 09.05.2016 11:24, Stefan Koch wrote:I see. I did not test a floating point value at the left-hand site. working on a fix.At Dconf Manu asked to use pow expressions at CTFE. Luckily he can. powExpressions work at ctfe.enum x=2.4^^4.5; DMD master: ./../../phobos/std/math.d(4857): Error: cannot convert &real to ushort* at compile time ./../../phobos/std/math.d(6113): called from here: isNaN(y) ./../../phobos/std/math.d(6303): called from here: impl(cast(real)x, cast(real)y) ctfepow.d(1): called from here: pow(2.4, 4.5)
May 09 2016
On Monday, 9 May 2016 at 12:33:33 UTC, Stefan Koch wrote:On Monday, 9 May 2016 at 12:24:18 UTC, Timon Gehr wrote:okay the workaround would be just to avoid pointer casts. And use bitwise operations to convert the values. Another option is not to jit std.math routines at ctfe. I would prefer the second option, any opinions ?On 09.05.2016 11:24, Stefan Koch wrote:I see. I did not test a floating point value at the left-hand site. working on a fix.At Dconf Manu asked to use pow expressions at CTFE. Luckily he can. powExpressions work at ctfe.enum x=2.4^^4.5; DMD master: ./../../phobos/std/math.d(4857): Error: cannot convert &real to ushort* at compile time ./../../phobos/std/math.d(6113): called from here: isNaN(y) ./../../phobos/std/math.d(6303): called from here: impl(cast(real)x, cast(real)y) ctfepow.d(1): called from here: pow(2.4, 4.5)
May 09 2016
On Monday, 9 May 2016 at 12:49:16 UTC, Stefan Koch wrote:On Monday, 9 May 2016 at 12:33:33 UTC, Stefan Koch wrote:Yet another option is using soft-float for ctfe, that would also prevent issues with cross-compiled binarys that have ctfe in them.On Monday, 9 May 2016 at 12:24:18 UTC, Timon Gehr wrote:okay the workaround would be just to avoid pointer casts. And use bitwise operations to convert the values. Another option is not to jit std.math routines at ctfe. I would prefer the second option, any opinions ?[...]I see. I did not test a floating point value at the left-hand site. working on a fix.
May 09 2016
On Monday, May 09, 2016 13:02:50 Stefan Koch via Digitalmars-d wrote:that would also prevent issues with cross-compiled binarys that have ctfe in them.That's going to be pretty critical in the long run, especially now that the compiler frontend is in D. - Jonathan M Davis
May 09 2016
On 9 May 2016 at 23:02, Stefan Koch via Digitalmars-d <digitalmars-d puremagic.com> wrote:On Monday, 9 May 2016 at 12:49:16 UTC, Stefan Koch wrote:This is almost certainly the correct solution... at least a soft-float implementation of pow, since it's an operator ;)On Monday, 9 May 2016 at 12:33:33 UTC, Stefan Koch wrote:Yet another option is using soft-float for ctfe, that would also prevent issues with cross-compiled binarys that have ctfe in them.On Monday, 9 May 2016 at 12:24:18 UTC, Timon Gehr wrote:okay the workaround would be just to avoid pointer casts. And use bitwise operations to convert the values. Another option is not to jit std.math routines at ctfe. I would prefer the second option, any opinions ?[...]I see. I did not test a floating point value at the left-hand site. working on a fix.
May 11 2016