On Fri Apr 06 13:02:33 2007, TELS wrote:
Show quoted text> On Wed Sep 27 11:56:17 2006, darkonc wrote:
> > I get an (apparently) infinite loop and a rapidly growing process when I
> > try
> >
> > perl -Mbignum=a,70 -le 'print 2**.02'
> >
> > A power of .05 also generates the error
> >
> > The boundary seems to be around a,66
> > $ perl -Mbignum=a,66 -le 'print 2**.002'
> > 1.00138725571133452908322477441877746756295469052830706855437611544
> >
> > but
> > $ perl -Mbignum=a,166 -le 'print 2**.5'
> >
1.41421356237309504880168872420969807856967187537694807317667973799073247
Show quoted text> >
>
>84621070388503875343276415727350138462309122970249248360558507372126441214
> > >97099935831413222666
> >
> > while
> > perl -Mbignum=a,166 -le 'print 2**.2'
> > takes a longtime (if not forever).
>
> The reason for this is that Math::BigFloat has two cached constants,for
> log(10) and log(2) and these constants are only 70 digits long. If you
> request a longer constant, the code just enters an infinite loop.
>
> I am still trying to find a way to fix this. Sorry for the delay.
>
> Tels
>
Fixed now :)
te@linux:~/perl/math/Math-BigInt-1.82> perl -Ilib -Mbignum=a,67 -le
'print 2**.002'
1.001387255711334529083224774418777467562954690528307068554376115444
te@linux:~/perl/math/Math-BigInt-1.82> perl -Ilib -Mbignum=a,167 -le
'print 2**.002'
1.0013872557113345290832247744187774675629546905283070685543761154436331272357105979602493007243703318658124815832662805515576188702665878149627153064933647363217407689
Will release v1.82 of Math::BigInt soon. Thank you for your report, well
spotted!
All the best,
Tels