math.pow fails at compile-time; is this a bug?
Caligo
iteronvexor at gmail.com
Sun Aug 19 21:38:01 PDT 2012
template T(){
enum a = pow(3.0, 2);
enum b = pow(3, 2.0);
}
unittest
{
alias T!() t;
}
compiling that I get:
/home/b/phobos/std/math.d(2369): Error: Cannot convert &real to ushort* at
compile time
/home/b/phobos/std/math.d(3292): called from here: isNaN(y)
/home/b/phobos/std/math.d(3403): called from here:
impl(x,cast(real)y)
/home/b/phobos/std/math.d(3239): called from here: pow(cast(real)x,y)
t.d(478): called from here: pow(3,2)
t.d(485): Error: template instance units.T!() error instantiating
I guess this a bug? any workarounds?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120819/af2606e1/attachment.html>
More information about the Digitalmars-d-learn
mailing list