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,dd2096591176a662 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Help with fixed types...insufficient model numbers? Date: 1997/04/01 Message-ID: #1/1 X-Deja-AN: 229980054 References: <5hrdic$sr@hacgate2.hac.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-01T00:00:00+00:00 List-Id: John Gluth asks about <> There is no model number subtlety here, just a plain obviously wrong declaration. 32 bits would be enough to fit the given range (just, with one bit to spare) if the delta were 1.0. Obviously with a delta of 0.0000256 you need far more bits. If you feed this to GNAT, you get: 1. package j is 2. Time_LSB : constant := 0.0000256; 3. type Time_Type is delta Time_LSB range 0.0 .. 2.0**31 - 1.0; 4. for Time_Type'Size use 32; | >>> size given (32) for type "Time_Type" too small, minimum is 47 5. for Time_Type'Small use Time_LSB; 6. end; which seems obviously right for storing numbers in the range you give with the least significant bit you give. It is not clear why this is puzzling, so I can't figure out more to say ...