On Dec. 21, 2011, I wrote:
-----------
> the relevant code for mfloat and mfloat1 is:
------------------
In the code for mfloat1, kk should start at kk=2
for efficiency's sake:
----------------------
mfloat1(ex,ndigits) :=
block([fpprec:16,old,new,kk,small,goodans:false],
small:bfloat(10^(-(ndigits+1))),
old : expand(bfloat(ex)),
for kk:2 thru 10 do
(new:realpart(block([fpprec:kk*10],expand(bfloat(ex)))),
if abs(new-old) < small then
(goodans:true,return()),
old:new),
if not goodans then false
else if not numberp(new) then false
else float(new))$
--------------
Ted