[Issue 2636] std.math.pow should be a template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 31 02:25:47 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2636





------- Comment #3 from clugdbug at yahoo.com.au  2009-01-31 04:25 -------
Steven - 
(1) Actually, since any x86 implementation using 80-bit reals returns the
result on the FP stack, double pow(double x) actually returns an 80-bit result!
So I think it's OK to return F.
(2) I've managed to sneak a couple of minor improvements into std.math since D1
was frozen, which closed the gap between Tango and Phobos. I think this problem
also can be fixed without any change to user code. I'll do it in Tango first,
though.
(3) pow(x, int) is a function which could sensibly be a compiler intrinsic. (In
fact there are interesting cases like pow(x, 15) which can be done most rapidly
as y = x*x*x; z = y*y return y * z*z; but which are only worth doing if you
know the exponent at compile time).


-- 



More information about the Digitalmars-d-bugs mailing list