From the Guile manual:

— Scheme Procedure: centered/ x y — Scheme Procedure: centered-quotient x y — Scheme Procedure: centered-remainder x y

These procedures accept two real numbers x and y, where the divisor y must be non-zero. centered-quotient returns the integer q and centered-remainder returns the real number r such that x = q*y + r and -|y/2| <= r < |y/2|. centered/ returns both q and r, and is more efficient than computing each separately.

Note that centered-quotient returns x/y rounded to the nearest integer. When x/y lies exactly half-way between two integers, the tie is broken according to the sign of y. If y > 0, ties are rounded toward positive infinity, otherwise they are rounded toward negative infinity. This is a consequence of the requirement that -|y/2| <= r < |y/2|.

Note that these operators are equivalent to the R6RS operators div0, mod0, and div0-and-mod0.

--Andy Wingo

resolution␣fixed

statusnewclosed

resolutionfixed␣

statusclosedreopened

I'm reopening this ticket based on the arguments below:

AFAIU centered/ is useful when you want to restrict the range of the result of division to be a fixnum, which is useful when implementing Scheme. See http://lists.gnu.org/archive/html/guile-devel/2011-01/msg00136.html .

statusreopeneddecided

WG1 accepted this proposal.

owneralexshinncowan

statusdecidedwriting

resolution␣wontfix

statuswritingclosed

Undone by #278.

We voted not to include this.