fn fixed_powi<T>(x: T, n: i128) -> Option<T>where
T: FixedPointNumber + Copy,Expand description
Raises a fixed-point number x to an integer power n using
binary exponentiation.
§Behavior
| Case | Result |
|---|---|
n = 0 | Some(1) - x^0 = 1 always |
n > 0 | Some(x^n) |
n < 0, x != 0 | `Some(1 / x^ |
n < 0, x = 0 | None - division by zero |
Uses saturating arithmetic throughout, so intermediate overflow clamps
to the type’s maximum rather than wrapping or panicking. Returns None
only for division-by-zero or when 1 / x^|n| is unrepresentable.
§Arguments
x- The fixed-point base.n- The integer exponent, includingi128::MIN.