[gambit-list] Patch to correct treatment of exact 0

Bradley Lucier lucier at math.purdue.edu
Tue Sep 24 14:11:26 EDT 2013


Marc:

The numerical library currently returns

> (expt 0 1.)
0
> (/ 0 1.)
0
> (/ 0 1.+1.i)
0

This small patch has it return

> (expt 0 1.)
0.
> (/ 0 1.)   
0.
> (/ 0 1.+1.i)
0.+0.i

which is what I believe R6RS does.

Gambit now passes most of the arithmetic and trigonometric and
transcendental function tests in the "Test Programs" part of

http://www.cesura17.net/~will/Professional/Standards/Scheme/R6RS/

The remaining differences are accuracy issues.  I'll need to recode the
complex inverse hyperbolic and inverse trigonometric routines as in
Kahan, W. "Branch Cuts for Complex Elementary Functions, or Much Ado
About Nothing's Sign Bit".

Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exact-zero.patch
Type: text/x-patch
Size: 878 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130924/4e9efa49/attachment.bin>


More information about the Gambit-list mailing list