<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>After playing a litle with procedure log i
found:</FONT></DIV>
<DIV><FONT face=Arial size=2>(1) (log positive-exact-integer) never returns
+inf.0 (although some time may be required, especially during compilation, for
exponents beyond one million)</FONT></DIV>
<DIV><FONT face=Arial size=2>(2) (log positive-exact-rational) may return
+inf.0, even when log does not return +inf.0 for larger exact
integers.</FONT></DIV>
<DIV><FONT face=Arial size=2>(3) Therefore I use (let ((x (inexact->exact
x))) (- (log (numerator x)) (log (denominator x)) for any real x.</FONT></DIV>
<DIV><FONT face=Arial size=2>(4) I ignore the fact that even the log may be too
big for a floating point. Anyway, when that is the case log does not return
before exhausting my patience, which is quite acceptible of course (I mean the
not returning, not my impatience:)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Questions:</FONT></DIV>
<DIV><FONT face=Arial size=2>(1) is this a correct approach (i.e. may I assume
that PLT scheme's log does not produce +inf.0 on very large exact
integer numbers? (as long as the log does not exceed 1e234)</FONT></DIV>
<DIV><FONT face=Arial size=2>(2) is there somewhere a solidly based (integer-log
positive-exact-integer-n) function that returns the greatest exact natural
number p such that (expt e p)<=n?</FONT></DIV>
<DIV><FONT face=Arial size=2>(3) An absolute error less than a few units would
not be a problem. I can always make a few steps up or down
afterwards.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In fact I use base 10 logs, but thats only a matter
of scaling.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I am speaking about Welcome to DrScheme, version
3.99.0.23-svn22apr2008 [3m].</FONT></DIV>
<DIV><FONT face=Arial size=2>Jos</FONT></DIV></BODY></HTML>