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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!feed.news.qwest.net!mpls-nntp-01.inet.qwest.net!132.250.1.121.MISMATCH!ra.nrl.navy.mil!bloom-beacon.mit.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Thu, 03 Apr 2014 18:56:34 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <2d62368c-9f64-49f3-98a8-5121d0c0fa23@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1396565800 8827 192.74.137.71 (3 Apr 2014 22:56:40 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 3 Apr 2014 22:56:40 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:I9b7ddbAz+UOizDoIwvWmBYREfY= Xref: news.eternal-september.org comp.lang.ada:19101 Date: 2014-04-03T18:56:34-04:00 List-Id: Qun-Ying writes: > Robert A Duff wrote: >> But I agree with you that Ada ought to require[*] 64-bit integers >> (and more, as Jeff Carter said). On the other hand, I have >> no use for Standard.Long_Long_Integer -- I just want to be >> able to say things like "range 1..2**123". >> - Bob >> > What prevents a compiler to implement that in the current standard? Nothing prevents it. It would cost money, though. Also, users might be surprised that: type Biggest_Integer is range System.Min_Int .. System.Max_Int; is extremely inefficient. And as I said, standards don't require anybody to do (or not do) anything. Standards compliance is optional. So even if the Ada RM forbade that, a compiler could allow it anyway (probably in a special mode, so it could still honestly claim conformance). But the fact that a compiler can implement very large integers isn't much use to people who care about portability to all conforming implementations. > Couldn't the compiler use internal representation (like using the gmp > lib) for such big range? It could. In fact, recent versions of GNAT support arbitrary-range integers for intermediate results. See Appendix D, "Overflow Check Handling in GNAT" in the GNAT User's Guide. - Bob