This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Ticket 302: Editorial: Consider unpacking the integer division routines

2012-10-07 12:24:08
WG1 - Core
cowan
major
cowan
wontfix
source
closed
2011-10-20 12:45:49
defect

From Denis Washington:

I think it would be much clearer and easier to phrase if the .../, ...-quotient, and ...-remainder procedures were described separately.

A proposal:

(floor/ n1 n2) division library procedure (ceiling/ n1 n2) division library procedure (centered/ n1 n2) division library procedure (truncate/ n1 n2) division library procedure (round/ n1 n2) division library procedure (ceiling/ n1 n2) division library procedure

It is an error if n2 is zero. These procedures implement number-theoretic integer division, that is, they compute a quotient nq and a remainder nr such that n1 = n2nq + nr. Both nq and nr are returned (in that order). How nq is chosen depends on the concrete procedure:

floor/ floor(n1/n2) ... (floor-quotient n1 n2) division library procedure (ceiling-quotient n1 n2) division library procedure (centered-quotient n1 n2) division library procedure (truncate-quotient n1 n2) division library procedure (round-quotient n1 n2) division library procedure (ceiling-quotient n1 n2) division library procedure

These procedures each return the quotient of (<operator>/ n1 n2), where <operator> is the respective procedure's name prefix that corresponds to the matching division procedure in the division library.

(floor-quotient n1 n2) division library procedure (ceiling-quotient n1 n2) division library procedure (centered-quotient n1 n2) division library procedure (truncate-quotient n1 n2) division library procedure (round-quotient n1 n2) division library procedure (ceiling-quotient n1 n2) division library procedure

These procedures each return the remainder of (<operator>/ n1 n2), where <operator> is the respective procedure's name prefix that corresponds to the matching division procedure in the the division library.

resolution
statusnewdecided

Postponed until we decide whether to cut back the division library.

owneralexshinncowan
statusdecidedwriting

We have cut division back to only 6 procedures, so this no longer looks necessary.

resolutionwontfix
statuswritingclosed