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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.ada Subject: Re: Ada.Numerics.Big_Numbers.Big_Integer has a limit of 300 digits? Date: Thu, 23 Dec 2021 14:01:47 +0000 Organization: A noiseless patient Spider Message-ID: <87o857ifn8.fsf@bsb.me.uk> 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 Injection-Info: reader02.eternal-september.org; posting-host="9575ea4c0a77e4149534aaf528f18a76"; logging-data="9317"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nzHYEMYakMK3Rg2Fis1/e/BP0JqmOR/4=" Cancel-Lock: sha1:ddZOPeA0MiDA9dfjYYPZSdMv3s0= sha1:m9T46yehQu/aplmekQGmXswRomk= X-BSB-Auth: 1.0d21f1495d9682394bf5.20211223140147GMT.87o857ifn8.fsf@bsb.me.uk Xref: reader02.eternal-september.org comp.lang.ada:63257 List-Id: Niklas Holsti writes: > 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. Yes, there are efficient algorithms for "x * y mod n" so almost all "big num" libraries provide a function to do it. Ada has the type system for the mod operation to be explicit in the type. -- Ben.