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!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Fixed-point question Date: Fri, 26 Jun 2015 09:56:41 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <249bcd57-3074-4566-b8f2-03e6923bfbce@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Fri, 26 Jun 2015 16:55:21 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a3855fbfe1a666be9aefba0563039ed5"; logging-data="16396"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+M6idrL2c0zaNytx/sJgnG2TZILL6P2HI=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <249bcd57-3074-4566-b8f2-03e6923bfbce@googlegroups.com> Cancel-Lock: sha1:5acpfTh56zPvyiusCH5ImXFkvw4= Xref: news.eternal-september.org comp.lang.ada:26485 Date: 2015-06-26T09:56:41-07:00 List-Id: On 06/26/2015 06:20 AM, Patrick Noffke wrote: > > type Fixed_Type is delta 1.0 / 180.0 range 0.0 .. 65535.0 / 180.0; What is Fixed_Type'Small? > C1 : constant Fixed_Type := Fixed_Type (N / D); What is C1'Size? If you really want to use multiples of 1/180, you probably want to do Delta_And_Small : constant := 1.0 / 180.0; type Fixed_Type is delta Delta_And_Small range 0.0 .. 65535.0 * Delta_And_Small; for Fixed_Type'Small use Delta_And_Small; -- Jeff Carter "I did not rob a bank. If I'd robbed a bank, everything would be great. I tried to rob a bank, is what happened, and they got me." Take the Money and Run 139