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,65b3f028266fd999 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!feedme.ziplink.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Question about ordinary fixed point types. Date: Tue, 17 Aug 2010 17:51:38 +0200 Organization: A noiseless patient Spider Message-ID: <87wrrputit.fsf@ludovic-brenta.org> References: <4c685fac$0$2373$4d3efbfe@news.sover.net> <4c688e67$0$2389$4d3efbfe@news.sover.net> <2981f976-6252-4d4f-9e6e-b121622cd92f@y11g2000yqm.googlegroups.com> <91d38fa6-4782-4e39-8df5-c4ba6d3a4ec7@d8g2000yqf.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 17 Aug 2010 15:51:39 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="d6NehdLq2K2fIJgoTWlIUQ"; logging-data="9129"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+Lqi3qwPE3zvwduIM8nlA" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:iAgjnG8RWhNlB8+R3CNHnmYp0B0= sha1:3ZCTtxWK+OffEqpqM16uzJZP9ms= Xref: g2news1.google.com comp.lang.ada:13459 X-Original-Bytes: 2402 Date: 2010-08-17T17:51:38+02:00 List-Id: sjw writes on comp.lang.ada: > On Aug 16, 11:03 am, 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. Yes but I suspect it requires 64-bit hardware. I don't think this would work on a 16-bit microcontroller. > 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. Right. -- Ludovic Brenta.