Re: [r6rs-discuss] rationale for expt

2012-09-20 Thread will
Alex Shinn wrote: One more thing - how was (expt 0 z) extended to return 0 for complex z? The approaches I've tried would result in NaN, and indeed this seems to be what most implementations return. You may be misinterpreting the R6RS. (expt 0 z) returns zero if the real part of z is

Re: [r6rs-discuss] rationale for expt

2012-09-20 Thread Alex Shinn
Hi Will, On Fri, Sep 21, 2012 at 12:08 AM, w...@ccs.neu.edu wrote: Alex Shinn wrote: One more thing - how was (expt 0 z) extended to return 0 for complex z? The approaches I've tried would result in NaN, and indeed this seems to be what most implementations return. You may be

Re: [r6rs-discuss] rationale for expt

2012-09-20 Thread will
Alex Shinn wrote: The question has to do with non-real z with positive real part, i.e. (expt 0.0 c+di), c 0, d != 0. As a simplification I can see how it would be useful to simply define this to be 0, but it can't be derived as far as I can see from the definition of complex

Re: [r6rs-discuss] rationale for expt

2012-09-20 Thread r6rsguy
From: w...@ccs.neu.edu You may be misinterpreting the R6RS. (expt 0 z) returns zero if the real part of z is positive. If z is zero, then it's supposed to return zero. From R6RS page 45: 0.0^z is 1.0 if z=0.0 You frightened me for a second. Knuth says it's one. QED -- Keith

Re: [r6rs-discuss] rationale for expt

2012-09-20 Thread will
Keith (r6rsguy) wrote: From: w...@ccs.neu.edu You may be misinterpreting the R6RS. (expt 0 z) returns zero if the real part of z is positive. If z is zero, then it's supposed to return zero. From R6RS page 45: 0.0^z is 1.0 if z=0.0 You frightened me for a second. My third

Re: [r6rs-discuss] rationale for expt

2012-09-20 Thread Alex Shinn
On Fri, Sep 21, 2012 at 12:39 AM, w...@ccs.neu.edu wrote: Although some implementors of the R6RS may have principled reasons for implementing expt in non-conforming fashion, I can't imagine what those reasons might be and I haven't heard of any such reasons. I suspect you're talking about

Re: [r6rs-discuss] rationale for expt

2012-09-19 Thread Alex Shinn
One more thing - how was (expt 0 z) extended to return 0 for complex z? The approaches I've tried would result in NaN, and indeed this seems to be what most implementations return. -- Alex On Thu, Aug 16, 2012 at 9:50 AM, w...@ccs.neu.edu wrote: Alex Shinn wrote: What I'm more interested

Re: [r6rs-discuss] rationale for expt

2012-08-15 Thread will
Alex Shinn wrote: What I'm more interested in is the unusual behavior that the result _either_ raises an exception _or_ returns an unspecified number. I believe this is the only place in any of the reports where the semantics is the disjunction of signalling an error and an unspecified

Re: [r6rs-discuss] rationale for expt

2012-08-15 Thread Alex Shinn
On Thu, Aug 16, 2012 at 9:50 AM, w...@ccs.neu.edu wrote: Alex Shinn wrote: What I'm more interested in is the unusual behavior that the result _either_ raises an exception _or_ returns an unspecified number. I believe this is the only place in any of the reports where the semantics is the