Opened 6 years ago

Closed 5 years ago

#302 closed defect (wontfix)

Editorial: Consider unpacking the integer division routines

Reported by: cowan Owned by: cowan
Priority: major Milestone:
Component: WG1 - Core Keywords:
Cc:

Description

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.

Change History (4)

comment:1 Changed 6 years ago by cowan

  • Status changed from new to decided

comment:2 Changed 6 years ago by cowan

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

comment:3 Changed 5 years ago by cowan

  • Owner changed from alexshinn to cowan
  • Status changed from decided to writing

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

comment:4 Changed 5 years ago by cowan

  • Resolution set to wontfix
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.