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.

Source for ticket #302

cc


    

changetime

2012-10-07 12:24:08

component

WG1 - Core

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.

id

302

keywords


    

milestone


    

owner

cowan

priority

major

reporter

cowan

resolution

wontfix

severity


    

status

closed

summary

Editorial: Consider unpacking the integer division routines

time

2011-10-20 12:45:49

type

defect

Changes

Change at time 2012-10-07 12:24:08

author

cowan

field

comment

newvalue


    

oldvalue

4

raw-time

1349587448297494

ticket

302

time

2012-10-07 12:24:08

Change at time 2012-10-07 12:24:08

author

cowan

field

resolution

newvalue

wontfix

oldvalue


    

raw-time

1349587448297494

ticket

302

time

2012-10-07 12:24:08

Change at time 2012-10-07 12:24:08

author

cowan

field

status

newvalue

closed

oldvalue

writing

raw-time

1349587448297494

ticket

302

time

2012-10-07 12:24:08

Change at time 2012-04-08 16:50:20

author

cowan

field

comment

newvalue

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

oldvalue

3

raw-time

1333878620176393

ticket

302

time

2012-04-08 16:50:20

Change at time 2012-04-08 16:50:20

author

cowan

field

owner

newvalue

cowan

oldvalue

alexshinn

raw-time

1333878620176393

ticket

302

time

2012-04-08 16:50:20

Change at time 2012-04-08 16:50:20

author

cowan

field

status

newvalue

writing

oldvalue

decided

raw-time

1333878620176393

ticket

302

time

2012-04-08 16:50:20

Change at time 2011-11-07 04:36:14

author

cowan

field

comment

newvalue

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

oldvalue

2

raw-time

1320611774000000

ticket

302

time

2011-11-07 04:36:14

Change at time 2011-10-20 12:46:55

author

cowan

field

comment

newvalue


    

oldvalue

1

raw-time

1319089615000000

ticket

302

time

2011-10-20 12:46:55

Change at time 2011-10-20 12:46:55

author

cowan

field

resolution

newvalue


    

oldvalue


    

raw-time

1319089615000000

ticket

302

time

2011-10-20 12:46:55

Change at time 2011-10-20 12:46:55

author

cowan

field

status

newvalue

decided

oldvalue

new

raw-time

1319089615000000

ticket

302

time

2011-10-20 12:46:55