This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inexact->exact


Marco Vezzoli wrote:
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.

Same goes for inexact->exact's use of an exception for an invalid number. Friendlier though would be to return infinity (negative or positive depending on the numerator's sign) rather than an exception at that point.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]