54248 {
54249 using store_t = typename T::StoreType;
54250
54252
54253 if (e < 0) {
54254 while (e++ < 0) {
54255 state.decimal = state.result % 10;
54256 state.result /= 10;
54257 if (state.result == 0 && state.decimal == 0) {
54258 break;
54259 }
54260 }
54261 if (state.decimal < 0) {
54262 state.decimal = -state.decimal;
54263 }
54264 state.decimal_digits = 1;
54265 return Finalize<T, NEGATIVE>(state);
54266 }
54267
54268
54269 while (state.result != 0 && e-- > 0) {
54270 if (!TryMultiplyOperator::Operation(state.result, (store_t)10, state.result)) {
54271 return false;
54272 }
54273 }
54274
54275 if (state.decimal == 0) {
54276 return Finalize<T, NEGATIVE>(state);
54277 }
54278
54279
54280 e = UnsafeNumericCast<int16_t>(exponent - state.decimal_digits);
54281 store_t remainder = 0;
54282 if (e < 0) {
54283 if (
static_cast<uint16_t>(-e) <= NumericLimits<store_t>::Digits()) {
54285 while (e++ < 0) {
54287 }
54288 remainder = state.decimal %
power;
54289 state.decimal /=
power;
54290 } else {
54291 state.decimal = 0;
54292 }
54293 } else {
54294 while (e-- > 0) {
54295 if (!TryMultiplyOperator::Operation(state.decimal, (store_t)10, state.decimal)) {
54296 return false;
54297 }
54298 }
54299 }
54300
54301 state.decimal_digits -= exponent;
54302
54303 if (NEGATIVE) {
54304 if (!TrySubtractOperator::Operation(state.result, state.decimal, state.result)) {
54305 return false;
54306 }
54307 } else if (!TryAddOperator::Operation(state.result, state.decimal, state.result)) {
54308 return false;
54309 }
54310 state.decimal = remainder;
54311 return Finalize<T, NEGATIVE>(state);
54312 }
Quat< T > power(const Quat< T > &q, const Quat< T > &p, QuatAssumeType assumeUnit=QUAT_ASSUME_NOT_UNIT)