comp.lang.ada
 help / color / mirror / Atom feed
From: Richard Iswara <haujekchifan@gmail.com>
Subject: Re: Constraint error overflow
Date: Wed, 28 Apr 2021 00:03:50 -0700 (PDT)	[thread overview]
Message-ID: <d7d88cf0-91cb-473d-bad0-fb024b6b7a61n@googlegroups.com> (raw)
In-Reply-To: <s69cdq$796$1@gioia.aioe.org>

On Tuesday, April 27, 2021 at 10:59:57 PM UTC+7, Dmitry A. Kazakov wrote:
> On 2021-04-27 17:32, Richard Iswara wrote: 
> > On Tuesday, April 27, 2021 at 10:00:22 PM UTC+7, Dmitry A. Kazakov wrote: 
> >> On 2021-04-27 16:04, Richard Iswara wrote: 
> >>> Ada beginner here. I was trying to multiply the first 100 integer and GNAT throw me a constraint error, overflow. I check the error was on integer 13. So what did I do wrong here? 
> >> Nothing, it is just so that 
> >> 
> >> 14! > 2**31 - 1
> > So the compiler is restricted to 32 bit integer value. I had hoped for 64 bit to get 18 digits.
> That won't give you 100! That is 158 digits or so. 
> 
> Long_Float gamma function should do the trick, or arbitrary precision 
> integer arithmetic.
> -- 
> Regards, 
> Dmitry A. Kazakov 
> http://www.dmitry-kazakov.de


Thank you all of you who responded and give very helpful advices. i am very much an amateur beginner in programming . . 

  reply	other threads:[~2021-04-28  7:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 14:04 Constraint error overflow Richard Iswara
2021-04-27 15:00 ` Dmitry A. Kazakov
2021-04-27 15:32   ` Richard Iswara
2021-04-27 15:38     ` Mark Lorenzen
2021-04-27 15:44     ` Shark8
2021-04-27 15:52     ` Jeffrey R. Carter
2021-04-27 15:59     ` Dmitry A. Kazakov
2021-04-28  7:03       ` Richard Iswara [this message]
2021-04-27 16:31     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox