From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) 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.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Constraint error overflow Date: Tue, 27 Apr 2021 17:52:23 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 27 Apr 2021 15:52:23 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="35fa0478e5561790154ea7d6f6714982"; logging-data="18734"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gniJKTibBlcpwlUhGcx5Y0xURd7yfxyM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cancel-Lock: sha1:dFwB2nJX9PC5ByDDYkeOD7ZpUeA= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61920 List-Id: On 4/27/21 5:32 PM, Richard Iswara wrote: > > So the compiler is restricted to 32 bit integer value. I had hoped for 64 bit to get 18 digits. No, the compiler defines type Integer as 32 bits. You can define other types with larger ranges. For trying to calculate 100!, even 64 bits is not enough; you'd need to use an unbounded integer package. -- Jeff Carter "There's no messiah here. There's a mess all right, but no messiah." Monty Python's Life of Brian 84