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,start X-Google-Attributes: gid103376,public From: John Gluth Subject: Help with fixed types...insufficient model numbers? Date: 1997/04/01 Message-ID: <5hrdic$sr@hacgate2.hac.com>#1/1 X-Deja-AN: 229907051 Distribution: world X-XXMessage-ID: Organization: HMSC Newsgroups: comp.lang.ada Date: 1997-04-01T00:00:00+00:00 List-Id: Can somebody help me understand this model number thing? I'm using the Rational Apex environment and compiling for a PowerPC 603e. Basic problem: I've got a 64 bit timer (running at 10 MHz) I don't need 64 bits of resolution (1 ms is adequate). I originally planned to use 32 bits of the timer, shifting left 8 bits, leaving me with LSB = 25.6 microseconds, and a rollover time of around 8 hours. So I tried doing this: Time_LSB : constant := 0.0000256; type Time_Type is delta Time_LSB range 0.0 .. 2.0**31 - 1.0; for Time_Type'Size use 32; for Time_Type'Small use Time_LSB; This leads to a complaint from the compiler along the lines of 'insufficient model numbers' I did a little more research. SAFE_SMALL is defined as 1.000000000E-04 As I understand it, SAFE_SMALL would indicate the smallest value for for 'Small that would give me enough model numbers to get the full range of values (-2.0**31 .. 2.0**31 -1.0)...true? I did a little experimenting, and found that if I use: Time_LSB : constant := 1.0; => No problem with 0..2.0 ** 31 - 1.0 Time_LSB : constant := 0.0001; => Insufficient model numbers (even using 0..2.0**30, 2.0**29, etc.) Time_LSB : constant := 0.1; => Still insufficient model numbers down to 2.0**29, etc. How does one determine what the maximum allowable range is? There is an attribute LAST, which is listed as 214748.3647 Is this my upper limit? If so, why? What's the largets upper bound I can get with a 32 bit fixed number and an LSB (Small) of around 1E-3? Thanks, John