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!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Fri, 4 Apr 2014 15:53:44 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <2d62368c-9f64-49f3-98a8-5121d0c0fa23@googlegroups.com> <1396504291.12566.134.camel@pascal.home.net> <1396545517.12456.30.camel@pascal.home.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1396644825 1151 69.95.181.76 (4 Apr 2014 20:53:45 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 4 Apr 2014 20:53:45 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:19134 Date: 2014-04-04T15:53:44-05:00 List-Id: "Jeffrey Carter" wrote in message news:lhkudj$28t$1@dont-email.me... > On 04/03/2014 02:17 PM, Randy Brukardt wrote: >> >> I : Unbounded_Integer := +1E1000; >> >> works today. > > I would like to see the definition of "+". I missed that someone wrote a literal that's insanely large. They should simply have written: I : Unbounded_Integer := (raise Storage_Error); because that's what will happen. I was thinking about more realistic cases: Thousand : Unbounded_Integer := +1000; But anyway, what works today for this *exact* literal (and not the more realistic cases I was thinking about): Really_Large : Unbounded_Integer := +10**1000; -- Or as a stickler +1*(+10**1000); alternatively: Really_Large : Unbounded_Integer := Value("1E1000"); [since you're going to have Image and Value routines anyway]. "+" looks like: type Largest_Int is range System.Min_Int .. System.Max_Int; function "+" (Right : Largest_Int) return Unbounded_String; I have an 64-bit math package for Janus/Ada that works exactly this way (need to it deal with some returns from OS operations), and it works well. Most of the literals that are needed are small (0, 1, 2, 10) and it's much preferable to write them using "+" rather than some unwieldy function name (To_Huge_Integer?). One could do something similar with Value if large literals were really common, but I doubt that they'll appear in expressions very often. Randy.