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] |
Jim White wrote:
Whoops. I just checked out how infinities are handled, and Kawa's gnu.math is actually doing everything quite nicely.Marco Vezzoli wrote: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.jim@pagesmiths.com wrote:That is the correct result. The logarithm of zero is not a number.... call to log (0.0) return from log => #i-1/0You 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.
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.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |