comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Creem <jeff@thecreems.com>
Subject: Re: Problem with Floating Points
Date: Fri, 14 Dec 2007 14:15:06 GMT
Date: 2007-12-14T14:15:06+00:00	[thread overview]
Message-ID: <lsca35-k4p.ln1@newserver.thecreems.com> (raw)
In-Reply-To: <a26c11ab-8209-48f1-9f64-6795de3071d3@t1g2000pra.googlegroups.com>

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.




      parent reply	other threads:[~2007-12-14 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-14  4:19 Problem with Floating Points DarthBob88
2007-12-14  4:49 ` DarthBob88
2007-12-14  6:48 ` tmoran
2007-12-14  9:33 ` Keith Thompson
2007-12-14 14:15 ` Jeffrey Creem [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox