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 X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!news.muarf.org!news.ecp.fr!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada202X : alternate syntax for ranged scalars Date: Wed, 1 May 2013 21:11:50 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <09e7fbc6-ea75-4660-8ece-25c5b096afd5@googlegroups.com> <3861a3cd-2513-4871-9062-2f2a53eb106b@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1367460715 26786 69.95.181.76 (2 May 2013 02:11:55 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 2 May 2013 02:11:55 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 2789 Xref: number.nntp.dca.giganews.com comp.lang.ada:181346 Date: 2013-05-01T21:11:50-05:00 List-Id: "Eryndlia Mavourneen" wrote in message news:3861a3cd-2513-4871-9062-2f2a53eb106b@googlegroups.com... >... > That said, we must assume that floating point values get translated > *exactly*; that is, >360.0 does not get translated to a machine type of 359.999999... or >360.0111111... Which of course makes no sense for most literals; it can only make sense for values that already correspond to machine numbers, and those already require exact conversion. The problem I see with such syntax is what precisely happens when the bound is not specified as a machine number? Say: type My_Flt digits 5 range not 0.6 .. not 2.6; Is this the same as the range without the "nots"? Or is it requiring something less than some unknown value in a particular interval? I don't see how that would be useful. Or are you going to require selecting a *particular* machine number in this case? That would be a massive change from the behavior of Ada currently, and probably would break some programs (that aren't portable but do work) be changing the values of their literals. The bounds of the range have to be machine numbers, as they don't have to be static; as such, we don't care about values that aren't machine numbers. So what exactly is this gaining over: subtype My_Flt is Float range Float'Succ(0.0)..Float'Pred(360.0); Randy.