comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: precise floats
Date: 1998/08/07
Date: 1998-08-07T00:00:00+00:00	[thread overview]
Message-ID: <m3u33plo6x.fsf@mheaney.ni.net> (raw)
In-Reply-To: 6qcoh0$3ump$1@prime.imagin.net

smize@news.imagin.net (Samuel Mize) writes:

> Assuming you want the greatest possible accuracy, perhaps best would be
> 
>   type my_very_precise_type is System.Max_Digits;
> 
>   subtype Fail_If_Not_Precise_Enough
>     is my_very_precise_type digits <N>;
> 
> So your variables will have the max precision available, and the
> compiler will warn you if it can't give you at least N digits.

Reduced accuracy subtypes are a deprecated feature (see RM95 J.3), so I
recommend not doing this.

Actually, it's not necessary anyway.  The compiler will reject the
declaration 

   type Fail_If_Not_Precise_Enough is digits N;

if it can't give you at least N digits.





  reply	other threads:[~1998-08-07  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-06  0:00 precise floats Robert Dewar
1998-08-06  0:00 ` Samuel Mize
1998-08-07  0:00   ` Matthew Heaney [this message]
1998-08-07  0:00     ` Robert Dewar
1998-08-06  0:00 ` Corey Ashford
  -- strict thread matches above, loose matches on Subject: below --
1998-08-04  0:00 Bob Fletcher
1998-08-04  0:00 ` Corey Ashford
1998-08-04  0:00   ` Corey Ashford
1998-08-05  0:00     ` Frank Klemm
1998-08-06  0:00       ` Robert Dewar
1998-08-06  0:00         ` dennison
1998-08-07  0:00           ` paul.english
1998-08-08  0:00             ` Robert Dewar
1998-08-12  0:00               ` Kevin Radke
1998-08-25  0:00               ` Gene Ouye
1998-08-10  0:00             ` dennison
1998-08-07  0:00           ` Robert Dewar
1998-08-07  0:00         ` Tom Weis
1998-08-07  0:00           ` Robert Dewar
1998-08-04  0:00 ` David C. Hoos, Sr.
1998-08-05  0:00   ` Bob Fletcher
1998-08-04  0:00 ` Christopher Green
1998-08-05  0:00 ` Matthew Heaney
1998-08-09  0:00 ` Bob Fletcher
replies disabled

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