[plt-scheme] order of magnitude

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Thu Nov 5 08:58:56 EST 2009

2009/11/5 Jos Koot <jos.koot at telefonica.net>:
> Let q be a positive rational (or real) number.
> I am looking for the greatest integer number m such that:
> (<= (expt 10 m) q)

I get:

greatest integer m s.t.:   10^m <= q
greatest integer m s.t.:   log(10^m) <= log(q)
greatest integer m s.t.:   m*log(10) <= log(q)
greatest integer m s.t.:   m <= log(q)/log(10)
                                    m = floor(log(q)/log(10))

-- 
Jens Axel Søgaard


Posted on the users mailing list.