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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,65b3f028266fd999 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!d8g2000yqf.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: Question about ordinary fixed point types. Date: Tue, 17 Aug 2010 07:35:04 -0700 (PDT) Organization: http://groups.google.com Message-ID: <91d38fa6-4782-4e39-8df5-c4ba6d3a4ec7@d8g2000yqf.googlegroups.com> References: <4c685fac$0$2373$4d3efbfe@news.sover.net> <4c688e67$0$2389$4d3efbfe@news.sover.net> <2981f976-6252-4d4f-9e6e-b121622cd92f@y11g2000yqm.googlegroups.com> NNTP-Posting-Host: 20.133.0.13 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1282055705 18379 127.0.0.1 (17 Aug 2010 14:35:05 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 17 Aug 2010 14:35:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d8g2000yqf.googlegroups.com; posting-host=20.133.0.13; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13456 Date: 2010-08-17T07:35:04-07:00 List-Id: On Aug 16, 11:03=A0am, Ludovic Brenta wrote: > However and unfortunately, ARM 3.5.9(21) allows an implementation to > reject any 'Small that is not a power of two (and, in particular, > decimal fixed-point types). I'm not sure whether GNAT supports > arbitrary Smalls; from the doc, it seems that it actually rounds them > down to a power of two no smaller than 2**(-63). 2**(-63)! That should be OK in this application, then. The real question for Peter is, what does his target compiler do? If it does as GNAT does and allows a delta and matching small of ada.numerics.pi / 2 ** 15 then it makes sense to work in your scheme, since literal values in the code and values for debug will be in radians. If it only alows binary smalls, then (I would) work with delta 2 ** (-15) range -1.0 .. 1.0, ie signed fractions of pi, and apply the scaling factor as required.