xtd 0.2.0
Loading...
Searching...
No Matches

◆ pow()

static double xtd::math::pow ( double  x,
double  y 
)
static

Returns a specified number raised to the specified power.

Parameters
xA double-precision floating-point number to be raised to a power.
yA double-precision floating-point number that specifies a power.
Returns
The number x raised to the power y.
Remarks
The following table indicates the return value when various values or ranges of values are specified for the x and y parameters. For more information, see Double::math::positive_infinity, Double::math::negative_infinity, and Double::NaN.
Parameters Return value
x or y = math::NaN. math::NaN
x = Any value except math::NaN; y = 0. 1
x = math::negative_infinity; y < 0. 0
x = math::negative_infinity; y is positive odd integer. math::negative_infinity
x = math::negative_infinity; y is positive but not an odd integer. math::positive_infinity
x < 0 but not math::negative_infinity; y is not an integer, math::negative_infinity, or math::positive_infinity. math::NaN
x = -1; y = math::negative_infinity or math::positive_infinity. math::NaN
-1 < x < 1; y = math::negative_infinity. math::positive_infinity
-1 < x < 1; y = math::positive_infinity. 0
x < -1 or x > 1; y = math::negative_infinity. 0
x < -1 or x > 1; y = math::positive_infinity. math::positive_infinity
x = 0; y < 0. math::positive_infinity
x = 0; y > 0. 0
x = 1; y is any value except math::NaN. 1
x = math::positive_infinity; y < 0 0
x = math::positive_infinity; y > 0. math::positive_infinity