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,b80661021d9cbcb1 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny08.POSTED!c9e1c1fe!not-for-mail From: Jeffrey Creem User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem with Floating Points References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 14 Dec 2007 14:15:06 GMT NNTP-Posting-Host: 71.168.122.204 X-Complaints-To: abuse@verizon.net X-Trace: trndny08 1197641706 71.168.122.204 (Fri, 14 Dec 2007 09:15:06 EST) NNTP-Posting-Date: Fri, 14 Dec 2007 09:15:06 EST Xref: g2news1.google.com comp.lang.ada:18946 X-Original-Bytes: 1751 Date: 2007-12-14T14:15:06+00:00 List-Id: DarthBob88 wrote: > I'm trying to use a Percentage type to show how often a given > condition occurred; like percent := matches/attempts. The only problem > is, it keeps outputting 0% for the result percentage. I have been > unable to get it to change its output, even to another nonsense answer > like that. Here follows my program, without the irrelevant portions. > > with Ada.Text_IO, Ada.Integer_Text_IO; > use Ada.Text_IO, Ada.Integer_Text_IO; > > procedure test is > type Percentage is Delta 0.01 range 0.00 .. 100.00; > --Runs from 0 to 100%, and goes to two decimal places. > This is a fixed point type not a floating point type. Also note that the comment below adds exactly zero value since it just says the same thing as the type. Comment why not the obvious what.