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 #185

cc


    

changetime

2012-10-05 06:49:38

component

WG1 - Core

description

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

id

185

keywords


    

milestone


    

owner

cowan

priority

major

reporter

cowan

resolution

wontfix

severity


    

status

closed

summary

Add sixth "centered" division operator

time

2011-05-20 07:35:00

type

defect

Changes

Change at time 2012-10-05 06:49:38

author

cowan

field

comment

newvalue

Undone by #278.

oldvalue

5

raw-time

1349394578852627

ticket

185

time

2012-10-05 06:49:38

Change at time 2012-10-05 06:49:38

author

cowan

field

resolution

newvalue

wontfix

oldvalue


    

raw-time

1349394578852627

ticket

185

time

2012-10-05 06:49:38

Change at time 2012-10-05 06:49:38

author

cowan

field

status

newvalue

closed

oldvalue

writing

raw-time

1349394578852627

ticket

185

time

2012-10-05 06:49:38

Change at time 2011-10-12 00:24:55

author

cowan

field

comment

newvalue


    

oldvalue

4

raw-time

1318353895000000

ticket

185

time

2011-10-12 00:24:55

Change at time 2011-10-12 00:24:55

author

cowan

field

owner

newvalue

cowan

oldvalue

alexshinn

raw-time

1318353895000000

ticket

185

time

2011-10-12 00:24:55

Change at time 2011-10-12 00:24:55

author

cowan

field

status

newvalue

writing

oldvalue

decided

raw-time

1318353895000000

ticket

185

time

2011-10-12 00:24:55

Change at time 2011-09-11 07:43:27

author

cowan

field

comment

newvalue

WG1 accepted this proposal.

oldvalue

3

raw-time

1315701807000000

ticket

185

time

2011-09-11 07:43:27

Change at time 2011-09-11 07:43:27

author

cowan

field

status

newvalue

decided

oldvalue

reopened

raw-time

1315701807000000

ticket

185

time

2011-09-11 07:43:27

Change at time 2011-08-16 23:39:21

author

cowan

field

comment

newvalue

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 .

oldvalue

2

raw-time

1313512761000000

ticket

185

time

2011-08-16 23:39:21

Change at time 2011-08-16 23:39:21

author

cowan

field

resolution

newvalue


    

oldvalue

fixed

raw-time

1313512761000000

ticket

185

time

2011-08-16 23:39:21

Change at time 2011-08-16 23:39:21

author

cowan

field

status

newvalue

reopened

oldvalue

closed

raw-time

1313512761000000

ticket

185

time

2011-08-16 23:39:21

Change at time 2011-07-10 21:43:42

author

alexshinn

field

comment

newvalue

We voted not to include this.

oldvalue

1

raw-time

1310309022000000

ticket

185

time

2011-07-10 21:43:42

Change at time 2011-07-10 21:43:42

author

alexshinn

field

resolution

newvalue

fixed

oldvalue


    

raw-time

1310309022000000

ticket

185

time

2011-07-10 21:43:42

Change at time 2011-07-10 21:43:42

author

alexshinn

field

status

newvalue

closed

oldvalue

new

raw-time

1310309022000000

ticket

185

time

2011-07-10 21:43:42