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

Marc Feeley feeley at iro.umontreal.ca
Tue Sep 24 17:35:04 EDT 2013


Thanks for the patch.

Marc

On 2013-09-24, at 2:11 PM, Bradley Lucier <lucier at math.purdue.edu> wrote:

> 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
> <exact-zero.patch>




More information about the Gambit-list mailing list