Skip Menu |

This queue is for tickets about the Math-BigInt CPAN distribution.

Report information
The Basics
Id: 21747
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Math-BigInt

People
Owner: TELS [...] cpan.org
Requestors: samuel [...] bcgreen.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: 1.82



Subject: Re: wierdity in bignum... (powers and high precision)
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).
On Wed Sep 27 11:56:17 2006, darkonc wrote: Show quoted text
> 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 > >84621070388503875343276415727350138462309122970249248360558507372126441214
> >97099935831413222666
> > while > perl -Mbignum=a,166 -le 'print 2**.2' > takes a longtime (if not forever).
I can confirm this, but I am not sure exactly why this happens. I do think it is a broken termination-condition in the bpow() function in BigFloat. Thanx for your report, Tels
From: TELS [...] cpan.org
On Wed Sep 27 11:56:17 2006, darkonc wrote: Show quoted text
> 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 > >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
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
This issue has been fixed in Math::BigInt v1.82. Thank you for your report!
Subject: Re: [rt.cpan.org #21747] Re: wierdity in bignum... (powers and high precision)
Date: Mon, 16 Apr 2007 21:59:45 -0700
To: bug-Math-BigInt [...] rt.cpan.org
From: "Stephen Samuel" <darkonc [...] gmail.com>
Thanks for fixing it... It's a lot more work fixing a bug like that than finding it. On 4/6/07, via RT <bug-Math-BigInt@rt.cpan.org> wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=21747 > > > On Fri Apr 06 13:02:33 2007, TELS wrote:
> > 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
> > >
> > > >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 >
-- Stephen Samuel http://www.bcgreen.com 778-861-7641
Closing again :) Please do not reply.