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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4f1dddd3318e056d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-04 03:51:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.icl.net!kibo.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: type declaration and storage requirements Date: 04 Jun 2002 11:35:40 +0100 Organization: Pushface Sender: simon@smaug Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk X-NNTP-Posting-Host: pogner.demon.co.uk:62.49.19.209 X-Trace: news.demon.co.uk 1023187803 nnrp-14:3538 NO-IDENT pogner.demon.co.uk:62.49.19.209 X-Complaints-To: abuse@demon.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: archiver1.google.com comp.lang.ada:25295 Date: 2002-06-04T11:35:40+01:00 List-Id: 18k11tm001@sneakemail.com (Russ) writes: > Suppose I have a particular range in mind, and I just want to get > the maximum number of digits I can get for, say, a 32-bit word. Is > there a simple way to determine how many digits to specify? If I > specify one digit too many, can it step the storage requirement from > one to two words? I'm no expert, but it seems to me that what you > really want to be able to specify is not the number of digits but > rather the total number of bytes to be used. If your requirement is to specify a size for the values, say type My_Short_Float_Type is new Float; type My_Long_Float_Type is new Long_Float; or subtype My_Short_Float_Type is Float; subtype My_Long_Float_Type is Long_Float; which are pretty likely to map to C float and double. If on the other hand your requirement is to specify the precision your algorithm requires, you really do need type My_Float_Type is digits 7; and if it turns out that that needs 8 bytes (ie double), so be it.