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=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada.Numerics.Big_Numbers.Big_Integer has a limit of 300 digits? Date: Thu, 23 Dec 2021 14:18:34 +0200 Organization: Tidorum Ltd Message-ID: References: <304dcae2-8b20-43ff-8769-32fa06d4dc10n@googlegroups.com> <41879a68-95cf-41e7-a582-4358a39f9d47n@googlegroups.com> <1880ebf1-a27a-4ae1-958b-cfb1e1fe50f2n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 5O0CP7p+5fMfohUYXt4qhA8Kp7gkvtgQdsbX1LhqlymhCh78XX Cancel-Lock: sha1:KV5k/hFfqe/KBs8sasoAl4pR3ho= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <1880ebf1-a27a-4ae1-958b-cfb1e1fe50f2n@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63255 List-Id: On 2021-12-23 13:41, AdaMagica wrote: > Niklas Holsti schrieb am Mittwoch, 22. Dezember 2021 um 20:05:21 UTC+1: >> However, the >> Big_Integers package does not directly support computations "mod" > > It does A.5.6(18/5). Yes, there is a "mod" operator for Big_Integer. My point was that there are no Big_Integer operations, such as multiplication, that are intrinsically modular in the same way as the operations for modular types are. So the only way to perform a modular multiplication of Big_Integers is to first multiply the numbers in the usual way, producing a possibly very large product, and then apply "mod" to reduce that product. In my imperfect understanding, intrinsically modular big-number computations can be much more efficient than such post-computation applications of "mod", at least if the modulus is not itself a big number.