Code speed

Don nospam at nospam.com
Wed Apr 14 01:12:12 PDT 2010


bearophile wrote:
> So far I've just given a light reading of the code. Notes:

> - pow(x, 2) and sqrt(y) can be written as x ^^ 2 and y ^^ 0.5 (but you have to import std.math anyway, because of a bug).

That's not a bug. It's intentional. x ^^ y will probably always require 
import std.math, if y is a floating point number.

Note that x^^2 doesn't require import std.math. (The fact that x ^^ 5 
requires import std.math is a temporary limitation).


More information about the Digitalmars-d-learn mailing list