From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,245c84afd1e393ce X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsmst01b.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr21.news.prodigy.com.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: <1581461.uQ1jN63t33@linux1.krischik.com> Subject: Re: What about big integers in Ada 2005? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: NNTP-Posting-Host: 71.129.220.244 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr21.news.prodigy.com 1127004370 ST000 71.129.220.244 (Sat, 17 Sep 2005 20:46:10 EDT) NNTP-Posting-Date: Sat, 17 Sep 2005 20:46:10 EDT Organization: SBC http://yahoo.sbc.com X-UserInfo1: FKPGW^WETZSMB_DX]BCBNWX@RJ_XPDLMN@GZ_GYO^ZUDUWYAKVUOPCW[ML\JXUCKVFDYZKBMSFX^OMSAFNTINTDDMVW[X\THOPXZRVOCJTUTPC\_JSBVX\KAOTBAJBVMZTYAKMNLDI_MFDSSOLXINH__FS^\WQGHGI^C@E[A_CF\AQLDQ\BTMPLDFNVUQ_VM Date: Sun, 18 Sep 2005 00:46:10 GMT Xref: g2news1.google.com comp.lang.ada:4853 Date: 2005-09-18T00:46:10+00:00 List-Id: "Martin Krischik" wrote in message news:1581461.uQ1jN63t33@linux1.krischik.com... > jtg wrote: > > > When I started to learn Ada, one of the most interesting features for me > > was the possibility to declare integer type of the specified range. > > I imagined that the integer type may be of any size. > > However, several years later I needed big integers and I was > > disappointed - Ada95 does not support integers of ANY size, > > it can support only those integers that are supported > > by the processor, or smaller. > > You are mistaken here. i.E GNAT supports 64 integers for 32 bit CPUs. It's > all up to the particular compiler. In theory you could create an Ada > compiler which supports intergers up to the memory limit - it would still > conform to the standart. > I interepreted this question to refer to integers of arbitrary size such as those in Smalltalk. In Ada compilers, as with other language with implementations tied to the underlying platrform, numbers are related to the word size of the targeted machine. For example, I cannot define, on any Ada compiler that I know of, an Integer such as, type Number is range 0..2**78; since this would overflow contemporary (not future) architectures. In Smalltalk, and many other languages, we can do arithmetic on numbers such as, 34567345754784567745464478456345356675 and 99874257918340987932560129346591237523 Of course, this is not an inherent limitation of Ada. One can create a package to do this kind of arithmetic, but it is not all that easy to do so. Richard Riehle