TOPICS
Search

Whole Shifted Inverse


A whole shifted inverse is an integer-scaled reciprocal used to replace division by multiplication and digit shifts while keeping the arithmetic in the integers (Watt 2023). Let B>1 be an integer base. The following equations define the base-B whole shift for integers n and u, and the whole shifted inverse for n>=0 and a nonzero integer v.

shift_(n,B)(u)=|_uB^n_|
(1)
shinv_(n,B)(v)=|_B^n/v_|.
(2)

When n>=0, the whole shift is multiplication by B^n. When n<0, it is integer division by a power of B. The whole shifted inverse is a reciprocal shifted into the integer domain. For example, shinv_(3,10)(8)=125.

Given positive integers u and v with u<=B^h, there is a delta in {0,1} such that

 |_u/v_|=shift_(-h,B)(ushinv_(h,B)(v))+delta.
(3)

Thus multiplication by the whole shifted inverse gives either the quotient or one less than the quotient.

The whole shifted inverse can itself be computed by an integer version of Newton's method. One refinement step has the form

 w_(i+1)=w_i+shift_(-h,B)(shift_(h,B)(w_i)-vw_i^2).
(4)

Under suitable initial conditions, the iterates remain integers and converge to shinv_(h,B)(v). For B=10, h=5, and v=37, the target is |_10^5/37_|=2702, and the initial value w_0=2000 gives

 2000->2520->2690->2702.
(5)

An analogous construction for univariate polynomials replaces B^n by x^n and can be used to compute a polynomial quotient (Watt 2023).

Marchioro et al. (2026) implemented whole-shifted-inverse division on a GPU for integer sizes from 2^(15) through 2^(18) bits. Their cost model for classical multiplication counts five to seven full multiplications for a complete quotient-and-remainder computation. They identify clipped products as a possible way to reduce this cost.


See also

Arbitrary Precision, Clipped Product, Floor Function, Integer Division, Newton's Method, Polynomial Quotient, Reciprocal

Explore with Wolfram|Alpha

References

Marchioro, M. B.; Raahauge, A. N.; Løvenskjold, M. I.; Oancea, C. E.; and Watt, S. M. "On GPU Implementation for Multi-Precision Integer Division." 11 Jul 2026. https://arxiv.org/abs/2606.06386v2.Watt, S. M. "Efficient Generic Quotients Using Exact Arithmetic." In International Symposium on Symbolic and Algebraic Computation 2023 (ISSAC 2023). New York: ACM, pp. 535-544, 2023. https://doi.org/10.1145/3597066.3597076.

Cite this as:

Weisstein, Eric W. "Whole Shifted Inverse." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/WholeShiftedInverse.html

Subject classifications