From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a0c:8031:: with SMTP id 46mr3345474qva.126.1640194076550; Wed, 22 Dec 2021 09:27:56 -0800 (PST) X-Received: by 2002:a25:2d42:: with SMTP id s2mr5541519ybe.646.1640194076263; Wed, 22 Dec 2021 09:27:56 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 22 Dec 2021 09:27:56 -0800 (PST) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=98.175.171.200; posting-account=_mt0NQoAAABIfwNsuLpi-_70qS5Wcu3m NNTP-Posting-Host: 98.175.171.200 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <304dcae2-8b20-43ff-8769-32fa06d4dc10n@googlegroups.com> Subject: Re: Ada.Numerics.Big_Numbers.Big_Integer has a limit of 300 digits? From: Michael Ferguson Injection-Date: Wed, 22 Dec 2021 17:27:56 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:63240 List-Id: On Wednesday, December 22, 2021 at 11:02:03 AM UTC-6, Luke A. Guest wrote: > On 22/12/2021 05:57, Michael Ferguson wrote: > > I just started using the Big_Integer library that is a part of the 202X version of ADA. > > > > It is repeatedly described as an "arbitrary precision library" that has user defined implementation. > > > > I was under the impression that this library would be able to infinitely calculate numbers of any length, but there is clearly a default limit of 300 digits. > What are you doing that requires that number of digits? I am working on ProjectEuler.net problem number 48. The questions asks you to sum the numbers n^n for (2 <= n <= 1000) and determine what the last ten digits of this number are. Obviously, this is quite a trivial problem when using any arbitrary precision library. I had incorrectly determined that 700^700 had 300 digits, in fact 700^700 = 3.7E1991. However, my code strictly breaks when the loop range is set to 683, which 683^683 = 8.12E1935. So, that is interesting that the Big_Integer type works numbers of just under 2000 digit length despite Bignum_Limit : constant := 200.