jim@pagesmiths.com wrote:
...
call to log (0.0)
return from log => #i-1/0
That is the correct result. The logarithm of zero is not a number.
You are right, I simply copied the routine and the examples the author
gived which included tests with zeroes. Maybe the scheme implementations
where the routine was written are more permissive (or simply wrong) with
the log arguments.
As far as a the specification goes, since the result of (log 0) is not
defined, there isn't any way to be wrong. Other implementations are
probably doing what Java does, which is to return a negative infinity
float. So actually I should have said it is undefined for Scheme (and
CL) specifications because IEEE does define -infinity as a number.