Re: [Scheme-reports] [scheme-reports-wg1] #370 log of zero
Mark H Weaver 26 Aug 2012 15:14 UTC
On 08/26/2012 04:26 AM, Alex Shinn wrote:
> According to:
>
> http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_sec_11.7.3.2
>
> "log 0 is undefined" which is the same as R5RS and
> the current draft.
>
> However, item #370 incorrectly claims that R6RS
> changed this to (log 0.0) => -inf.0 and (log 0) => error,
> and we voted on that.
No, the claim in #370 is correct. In R6RS section 11.7.4.3 (Arithmetic
operations), the following two examples are explicitly given:
http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_sec_11.7.4.3
(log 0.0) => -inf.0
(log 0) &assertion exception
The sentence you quoted does not contradict this. First of all, it says
"log 0", not "log 0.0". It is clear that the text distinguishes 0 and
0.0, as you can see in the table at the bottom of section 11.7.3.2 for
two-argument arctangent, which contains the following entries (for
implementations that distinguish minus zero):
y condition x condition range of result
===========================================
y = + 0.0 x = + 0.0 + 0.0
y = - 0.0 x = + 0.0 - 0.0
y = + 0.0 x = - 0.0 pi
y = - 0.0 x = - 0.0 - pi
y = + 0.0 x = 0 (pi/2)
y = - 0.0 x = 0 - (pi/2)
Furthermore, it should be noted that section 11.7.3.2 defines the
underlying mathematical operations, which are not quite the same as the
associated scheme procedures. Typically, if the mathematical operation
is not defined at a given point and the argument is inexact, then a
limit will be taken. For example (log 0.0) is evaluated as the limit of
mathematical log(x) as x goes to zero from above, but (log 0) must throw
an error.
> Since the item was mis-stated and the change has
> no precedent I'm annulling it.
The item is stated correctly, and therefore I see no grounds for
annulling this change.
Mark
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports