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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,544e7f5698c48b7c X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: precise floats Date: 1998/08/07 Message-ID: #1/1 X-Deja-AN: 378754430 Sender: matt@mheaney.ni.net References: <6qcoh0$3ump$1@prime.imagin.net> NNTP-Posting-Date: Thu, 06 Aug 1998 22:45:57 PDT Newsgroups: comp.lang.ada Date: 1998-08-07T00:00:00+00:00 List-Id: 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 ; > > 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.