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)
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 602
Download (untitled) / with headers
text/plain 602b
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).
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-25775-1169899366-1868.21747-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 865
Download (untitled) / with headers
text/plain 865b
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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-16497-1175878953-473.21747-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: TELS [...] cpan.org
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 970
Download (untitled) / with headers
text/plain 970b
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
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-16497-1175878953-473.21747-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-16614-1175879974-1494.21747-0-0 [...] rt.cpan.org>
References: <rt-3.6.HEAD-16497-1175878953-473.21747-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1598
Download (untitled) / with headers
text/plain 1.5k
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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-18041-1176727001-548.21747-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 75
This issue has been fixed in Math::BigInt v1.82. Thank you for your report!
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VERIFIED,DK_POLICY_SIGNSOME,DK_SIGNED,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-16614-1175879974-1494.21747-6-0 [...] rt.cpan.org>
Content-Disposition: inline
Received-SPF: pass (x1.develooper.com: domain of darkonc [...] gmail.com designates 64.233.162.225 as permitted sender)
References: <RT-Ticket-21747 [...] rt.cpan.org> <rt-3.6.HEAD-16497-1175878953-473.21747-6-0 [...] rt.cpan.org> <rt-3.6.HEAD-16614-1175879974-1494.21747-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: ISO-8859-1
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 4E47C4D80B4 for <bug-Math-BigInt [...] rt.cpan.org>; Tue, 17 Apr 2007 00:59:54 -0400 (EDT)
Received: (qmail 28302 invoked by alias); 17 Apr 2007 04:59:53 -0000
Received: from nz-out-0506.google.com (HELO nz-out-0506.google.com) (64.233.162.225) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 16 Apr 2007 21:59:50 -0700
Received: by nz-out-0506.google.com with SMTP id m22so1364764nzf for <bug-Math-BigInt [...] rt.cpan.org>; Mon, 16 Apr 2007 21:59:45 -0700 (PDT)
Received: by 10.115.93.16 with SMTP id v16mr2243872wal.1176785985407; Mon, 16 Apr 2007 21:59:45 -0700 (PDT)
Received: by 10.114.130.2 with HTTP; Mon, 16 Apr 2007 21:59:45 -0700 (PDT)
Delivered-To: cpan-bug+math-bigint [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #21747] Re: wierdity in bignum... (powers and high precision)
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Tk3GCgAiyUnppvs5j/YF8Nj69WHEQ1sUqS/7M9At+k0LW5e1vLmkFsHGyJtz9X/P7cEhS+zURVkLyCNbbvbmq5gLpmBNv56BfU+A/B4wOyDiGLuCqt+RKywlKRGfH5OQjn1M0EboGAj0QpxVM1m4765e9LRxEzFwG10gFcQKRQU=
Return-Path: <darkonc [...] gmail.com>
Dkim-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nLYRcL3+sfltRMCfsK/NX8b0rFlAqYyjTpTmYkSo7clrczzEPJ9ww0isRcEbKxm/cfgB3L1ETtWfvuJRJSuciCBCRHHPFKJwMwvBqc/rPfY637L8M4CLBhrN8GEFqVhy+KW8QWc4cQ9gCG5fT/MEGh9/2fQHuU61GhpvP/QiNCs=
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-Math-BigInt [...] rt.cpan.org
Date: Mon, 16 Apr 2007 21:59:45 -0700
Message-Id: <6cd50f9f0704162159q31f1f8a5i6b9ba3de741b4745 [...] mail.gmail.com>
To: bug-Math-BigInt [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: "Stephen Samuel" <darkonc [...] gmail.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-18041-1176786019-1072.21747-0-0 [...] rt.cpan.org>
Content-Length: 1947
Download (untitled) / with headers
text/plain 1.9k
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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-17943-1176796325-1711.21747-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 37
Closing again :) Please do not reply.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.