D Documentation [ Log in ]
std.math.pow
real pow(real x, real y)

This function returns x^y.

Example:
// We use cast here to tell the compiler what we are talking about.

writefln("pow(3,4)    is %d",cast(int)pow(cast(float)3,cast(float)4));
writefln("pow(4,3)    is %d",cast(int)pow(cast(float)4,cast(float)3));

Output:
pow(3,4)    is 81
pow(4,3)    is 64

See also:
std.math.sqrt, std.math.hypot
PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.
This is the inofficial wiki for documenting the D programming language.
- Profiler -
Time for site generation: 0.0174 s